Forum Moderators: open

Message Too Old, No Replies

Vertical align Text

         

Gemini23

7:58 pm on Feb 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can anyone advise what the css code for vertically aligning text is in Chrome? or that will work with IE, Firefox etc as these all do align text on my website vertically... but chrome doesn't

Thanks

Fotiman

8:02 pm on Feb 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How are you aligning it?

Gemini23

8:20 pm on Feb 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Currently using: vertical-align: middle;

which works for other browsers...

Fotiman

8:40 pm on Feb 4, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



vertical-align is not meant to apply for centering text. This is an often misunderstood style, and in all fairness it is a shortcoming of CSS2. There is an example here:
[w3.org...]

Which uses:

display: table-cell;
vertical-align: middle