kurt.santo Posted September 26, 2007 Report Share Posted September 26, 2007 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 More sharing options...
Shonumi Posted September 26, 2007 Report Share Posted September 26, 2007 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 More sharing options...
kurt.santo Posted September 27, 2007 Author Report Share Posted September 27, 2007 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now