471,599 Members | 1,158 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

centering text vertically in div

Can anyone tell me how to center a random amount of text vertically in
a div so it is centered like it would be in a table cell by default?
I do not know if JavaScript is applicable here, but I do not want to
use JavaScript, since it can be turned off. I do not want to have to
tell the reader to turn it on, either. Thanks.

Nov 9 '07 #1
1 2920
On 2007-11-09, ru*****@fastmail.fm <ru*****@fastmail.fmwrote:
Can anyone tell me how to center a random amount of text vertically in
a div so it is centered like it would be in a table cell by default?
I do not know if JavaScript is applicable here, but I do not want to
use JavaScript, since it can be turned off. I do not want to have to
tell the reader to turn it on, either. Thanks.
It's not possible as far as I know without using display: table-cell.
The only way to get IE to approximate the correct behaviour of display:
table-cell is to use a <td>. So if you need IE support, use a table.
Nov 9 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by George Ziniewicz | last post: by
3 posts views Thread by CMAR | last post: by
7 posts views Thread by Aaron | last post: by
1 post views Thread by Kenneth | last post: by
7 posts views Thread by Bill | last post: by
3 posts views Thread by Robert Latest | last post: by
2 posts views Thread by anonymous | last post: by
6 posts views Thread by Jerry Camel | last post: by
3 posts views Thread by John Pote | last post: by
5 posts views Thread by Markus Ernst | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.