I'm trying to vertically align text in a couple of containers using line-height
, but it just won't work. I have never had any problems with it before, but for some reason it just won't line up properly now.
Now, I'm probably just blind from all the coding, but I just can't seem to find where the problem lies...
This is how my HTML looks like:
<div class="formLabel">
<div class="labelNumber">D</div>
<div class="labelTitle">
<h2>New Password</h2>
<p>Check Help for character and length restrictions</p>
</div>
</div>
and this is how my CSS looks like:
.formLabel
{
position: relative;
width: 400px;
height: 40px;
padding: 20px 0px 0px 10px;
margin: 0;
}
.labelNumber
{
float: left;
width: 30px;
height: 30px;
line-height: 30px;
background: #191919;
font: bold 18px Arial;
color: #555555;
text-align: center;
padding: 0;
margin: 0;
}
It's the character in the .labelNumber
container that I'm trying to vertically align.