Why doesn't max-height hold in Mobile safari in landscape mode?

Posted by Mick79 on Pro Webmasters See other posts from Pro Webmasters or by Mick79
Published on 2012-09-09T15:48:51Z Indexed on 2012/09/09 21:49 UTC
Read the original article Hit count: 215

Filed under:

I am building a small portfolio site for myself and have come across an odd quirk. I have an image inside a container, and to allow for multiple screen sizes, I am setting all dimensions in % rather than pixels.

in iphone portrait mode, everything is fine. However in landscape mode, my image bursts out of its container, completely ignoring the max-height:100%; rule that works fine in portrait.

code:

#centralident{
position:relative;
width:50%;
height:50%;
box-shadow: 0 0 10px black;
margin-left:25%;
margin-top:13%;
}


#centralident img{
max-height:100%;
}

© Pro Webmasters or respective owner

Related posts about css