CSS Max Width


Sometimes you want to not break a layout, but you can't guarantee any image size. This is where the max-width CSS comes in. However, this will not work on IE. For IE, you have to fake it.

I use this

max-width: 100%;
width: expression(this.width >
 560 ? 560: true);



Oh and to overide it for things like google maps, just make sure to include them in a div and use:

#gmaps img {
  max-width: none;
  width: auto;
}

Related Categories

Html