Allen Pitts
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.
http://www.vanseodesign.com/css/vertical-centering/
<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.
Thanks.
Allen in Dallas
Working on vertically aligning some text in a CSS <div>.
I found a site that claims to provide a solution using
CSS tables.
http://www.vanseodesign.com/css/vertical-centering/
<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.
Thanks.
Allen in Dallas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Maybe in your page you have some other rule which breaks the layout...