Thursday 5 September 2013

A Really Simple Way To Make All Images Fit On Screen

If you want to make sure your images always fit in their containing <div> or window, simply add the following line to your style sheet:

img {max-width: 100%;}

Simple, but effective.

You'll still be sending the full size image to the device, even if you're not displaying it in full size, which isn't ideal, but at least you won't have any horizontal scrolling or content obscured by your images.

No comments:

Post a Comment