Welcome to WebmasterWorld Guest from 54.198.100.0

Forum Moderators: open

Message Too Old, No Replies

Vertical align Text

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

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 618
votes: 3


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
8:02 pm on Feb 4, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12


How are you aligning it?
8:20 pm on Feb 4, 2011 (gmt 0)

Preferred Member

5+ Year Member Top Contributors Of The Month

joined:Aug 30, 2007
posts: 618
votes: 3


Currently using: vertical-align: middle;

which works for other browsers...
8:40 pm on Feb 4, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12


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