vertical align content in a div

Associate
Joined
26 Jun 2003
Posts
1,140
Location
North West
Whats the equivelant to align text in a div/css vertically with the same effect as tables:

<td valign="middle">Middle</td>

?

Thx
 
It's not that clean cut. If the div is a fixed height and the image height is unlikely to change, either use padding on the div to push the image down or a margin on the image to do the same thing.
 
toosepin said:
It's not that clean cut. If the div is a fixed height and the image height is unlikely to change, either use padding on the div to push the image down or a margin on the image to do the same thing.

Yeah thats what i've done. Just figured it wasnt an ideal solution. If it's all fine and dandy, then grand :)
 
think ive found out. not found any probs so far.

if your div is 100px. Set this in your css:
line-height: 100px

Then your away :p
 
Back
Top Bottom