I'm trying to find a solution how to vertically align image in a div with 100% height (I don't know it's height).
I've got this HTML. I can't do much with HTML except add more wrappers:
<div id="wrapper">
<img src="http://www.lovecpokladu.cz/nalezy/9687/5.jpg" alt="" />
</div>
And this quite fixed CSS - primary I need to accomplish that the image doesn't overflow browser's window in all browsers:
#wrapper {
position: absolute;
width: 100%;
height: 100%;
background: #ddd;
}
img {
max-width: 100%;
max-height: 100%;
}
Thanks a lot!