Avatar of Allen Pitts
Allen Pitts
Flag 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.

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
CSS

Avatar of undefined
Last Comment
Marco Gasi

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rob

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Marco Gasi

Maybe in your page you have some other rule which breaks the layout...
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy