center text in div
Posted
by Son of anarchy
on Stack Overflow
See other posts from Stack Overflow
or by Son of anarchy
Published on 2010-03-12T07:45:06Z
Indexed on
2010/03/12
7:47 UTC
Read the original article
Hit count: 256
<div>
<div class="left">
<div align="center" class="node">
<div class="nodeText">
<h2 >test</h2>
</div>
<div class="node">
<h2>test</h2>
</div>
<div class="node">
<h2>test</h2>
</div>
<div>
I need to center text in div nothing seems to work
.left { float:left; width:200px; border:solid 1px black; text-align: center; } .node { height:200px; border:solid 1px black; margin:0 auto; } .nodeText{ vertical-align: middle; } h2{ text-align: center; }
Tnxs
© Stack Overflow or respective owner