Need a responsive img inside a container with a max-width.
HTML:
<div class="center-content">
<img src="assets/test-slider.png" alt="" />
</div>
CSS:
/*center-content*/
.center-content{
position:relative;
max-width:1200px;
margin:0 auto;}
/*img-fix*/
img{
max-width: 100%;
height: auto;
}
This works fine in -webkit but not in firefox...
Any help would be appreciated.
/EDIT/
http://jsfiddle.net/WKHHR/
Check the difference between Firefox & Chrome
the CSS for your image is wrong instead of
img{
max-width: 100%;
height: auto;
}
put
img{
width: 100%;
height: auto;
}
This is because you always want the image width to be 100% of it's parent div.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With