Jump to content

Vertical alignment


kurt.santo
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...