Intelligent Image Cropping - Example #1

a basketball game

In this example, the maximum width of the image is set to 100% of its container width:

img {
  max-width: 100%;
}

Because IE doesn’t understand the max- and min- style sheet declarations, an IE-only stylesheet is used to set the width to 100%.

If you resize the window, the entire image will grow or shrink. Return to the article.