I want all (or just some) of my images getting resized automatically when I resize my browser window. I\'ve found the following code - it doesn\'t do anything though.
<
To make the images flexible, simply add
max-width:100%andheight:auto. Imagemax-width:100%andheight:autoworks in IE7, but not in IE8 (yes, another weird IE bug). To fix this, you need to addwidth:auto\9for IE8.source: http://webdesignerwall.com/tutorials/responsive-design-with-css3-media-queries
for example :
img {
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
}
and then any images you add simply using the img tag will be flexible
JSFiddle example here. No JavaScript required. Works in latest versions of Chrome, Firefox and IE (which is all I've tested).