Jump to content

Vertical alignment


kurt.santo

Recommended Posts

How do I vertically align text to the middle of adjacent div (containing photo)?The code is as follows...

<div id="barCont"><div id="bar"><img src="photosSameSize/property.jpg" alt="" width="150" height="100"/><img src="photosSameSize/property.jpg" alt="" width="150" height="100"/><img src="photosSameSize/property.jpg" alt="" width="150" height="100"/></div> <div id="headline">Heading<br />and some text</div><br class="clearfloat" /></div>

Kurt

Link to comment
Share on other sites

You could either make the padding or margins at the top and bottom of the content elements equal to half the height. Don't set them to something solid, make sure it's a percentage.

Link to comment
Share on other sites

You could either make the padding or margins at the top and bottom of the content elements equal to half the height. Don't set them to something solid, make sure it's a percentage.
Unfortunately cannot use a percentage. The div next to it has a picture with padding and margin of 0px, so I have to set it to the middle of the picture as such ...Kurt
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...