Sunday 15 February 2015

ie8 responsive image

You can make the image auto resize to the max width of the boundary by using max-width:100% and height:auto.
img {
 max-width: 100%;
 height: auto;
}
The above responsive image CSS works on IE7 and IE9, but doesn't work on IE8. To fix it, add width:auto. You may apply a conditional CSS specifically for IE8 or use the IE hack below:
@media \0screen {
  img { 
   width: auto; /* for ie 8 */
  }
}