son Posted November 8, 2010 Share Posted November 8, 2010 Dynamically I display several photos inside a div that has a border. The photo can either be portrait or landscape. I would like the photo to be horizontally and vertically in middle/center, but struggle with the vertical alignment. I set the div as: height:100px; width:100px; vertical-align:middle; To the photo (which can only have max height and width of 100px) I applied margin:auto 0; It simply won't display vertically in middle. With text-align center I have them nicely horizontally aligned. Is there any good way to achieve this for the vertical display?Thanks,Son Link to comment Share on other sites More sharing options...
lastlifelost Posted November 8, 2010 Share Posted November 8, 2010 http://w3schools.invisionzone.com/index.php?showtopic=34466Take a look at the link above. The topic was a little different, but the solutions offered will work just as well in your case. If you still have questions, go ahead and post them here! Link to comment Share on other sites More sharing options...
son Posted November 9, 2010 Author Share Posted November 9, 2010 http://w3schools.invisionzone.com/index.php?showtopic=34466Take a look at the link above. The topic was a little different, but the solutions offered will work just as well in your case. If you still have questions, go ahead and post them here!Thanks, will check this out...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.