6
On a page I’m developing, a web page where I have an image that fits itself according to the field space. to do this, I used the property max-width:100%
that is advised on the web to make this kind of adaptation in responsive templates.
My problem is that when checking in browser IE9, this image is responsive in width but gets stretched in height.
My code:
HTML:
<div>
<img id="logo" src="http://3.bp.blogspot.com/-mAbLcUMIhgc/Tp_1XrkQhfI/AAAAAAAAACU/pNqm50MEplM/s1600/imagem_noticia_02.jpg" class="transparent2" width="100%"/>
</div>
CSS:
html{
background:#666;
}
div{
width:50%;
height:100%;
margin-left:25%;
background:#eee
}
#logo{
max-width:100%;
}
Also in the put in the Jsfiddle.
If you give a width on the img tag, the height will always be proportional. I think this is your solution.
– ninja_corp
no, actually it should be like this but by irony uncle bill the IE9 does not respect this pattern and it resizes alone...
– LeandroLuk
ready @Ricardo
– LeandroLuk