Link to home
Start Free TrialLog in
Avatar of Allen Pitts
Allen PittsFlag for United States of America

asked on

verticle center with CSS Tables

Hello expert,

Working on vertically aligning some text in a CSS <div>.
I found a site that claims to provide a solution using
CSS tables.

 <div style="display: table; background: yellow;">
 <div style="display: table-cell; background: blue; color: white; height:62px; width: 162px; vertical-align: middle;">
 some text text text</div>

But this does not vertically center the text.

Am I doing something wrong.


Allen in Dallas
Avatar of Rob
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Maybe in your page you have some other rule which breaks the layout...