Fitting images for Mobile
Modified on 2010/06/25 09:11 by Administrator — Categorized as: Mobile
If an image has to be shrunk to fit a maximum width, the height line ensures that the height is adjusted as well so that the aspect ratio is maintained. The max-width line ensures that an image not inserted through the standard method would still fit the horizontal limits of the screen.
img { height: auto; max-width: 100%; }