HighDots Forums  

combining "text-align: center" and "font-size: 22px"

HTML Writing HTML for the Web (comp.infosystems.www.authoring.html)


Discuss combining "text-align: center" and "font-size: 22px" in the HTML forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Smith
 
Posts: n/a

Default combining "text-align: center" and "font-size: 22px" - 10-17-2009 , 12:40 PM






How do I put "font-size: 22px" and "text-align: center" in a
single tag?

If I put both of them in <span>, alignment doesn't work. If I put
"text-align: center" in <div> and the other in <span> fontsize
doesn't work. If they are both in <div>, alignment doesn't work.
In short, I can't have them both work in one tag.

Any solution? Thanks.

Reply With Quote
  #2  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: combining "text-align: center" and "font-size: 22px" - 10-17-2009 , 01:13 PM






Gazing into my crystal ball I observed John Smith <jsmith (AT) company (DOT) com>
writing in news:hbcs0m$280$1 (AT) aioe (DOT) org:

Quote:
How do I put "font-size: 22px" and "text-align: center" in a
single tag?
Font sizes should not be expressed in pixels as some popular browsers
cannot resize them. Use ems or percentages.

Quote:
If I put both of them in <span>, alignment doesn't work. If I put
"text-align: center" in <div> and the other in <span> fontsize
doesn't work. If they are both in <div>, alignment doesn't work.
In short, I can't have them both work in one tag.

Any solution? Thanks.

Hmmm, this looks like it might be a heading element that is being badly
cobbled together. Of course, I don't have my crystal ball today, so
without a URL, it's impossible to say.

What you might want is a heading element that you can style accordingly.
I would suggest an external stylesheet, or if you must, the style
element in the head of your document. There is no need to use inline
style for this.

h1 {font-size:140%; text-align:center;}


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #3  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: combining "text-align: center" and "font-size: 22px" - 10-17-2009 , 01:17 PM



John Smith wrote:

Quote:
How do I put "font-size: 22px" and "text-align: center" in a
single tag?
<a style="font-size: 22px; text-align: center">

It's very bad practice, but that's the answer to the question.

Quote:
If I put both of them in <span>, alignment doesn't work.
Of course it doesn't, other things being defaulted, but that's a CSS issue.
We're discussing HTML here.

Quote:
If I put
"text-align: center" in <div> and the other in <span> fontsize
doesn't work.
This too is about CSS, not HTML, but in addition to that, it's nonsense
unless you specify a demo URL and the browser(s) on which that happens. And
of course your HTML syntax could be all wrong, and then all bets are off.

Quote:
If they are both in <div>, alignment doesn't work.
Surely it does, but the odds are that you expect text-align to have a
meaning that is different from its defined meaning.

Quote:
In short, I can't have them both work in one tag.
Yes you can. Your problem is something different.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote
  #4  
Old   
Petr Vileta \fidokomik\
 
Posts: n/a

Default Re: combining "text-align: center" and "font-size: 22px" - 10-18-2009 , 09:42 AM



John Smith wrote:
Quote:
How do I put "font-size: 22px" and "text-align: center" in a
single tag?

If I put both of them in <span>, alignment doesn't work. If I put
"text-align: center" in <div> and the other in <span> fontsize
doesn't work. If they are both in <div>, alignment doesn't work.
In short, I can't have them both work in one tag.

Try <div style="text-align: center; font-size: 22px !important"
--
Petr Vileta, Czech Republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.