I think this question has been asked many a times but I’ve been searching the web for a whole day now and cannot find a single good solution. I want to centre an image inside a div so that it looks like a frame. I have images of different sizes, some are portrait, some landscape. I want them to be centered horizontally and vertically and that it does not overflow the container if the size is larger. Now I’ve read about div vs table designs but seriously, right now I just want the job done, so any solution would be greatly appreciated.
Share
Check the demo – http://jsfiddle.net/x6jDu/
table-cell has IE8+ support