Ernie,
A few things about the code:
-
When it comes to images,
max-width:100%
means a very different thing than it would if it was applied to a div. With a div, I agree, that CSS would be nonsense. However, when applied to an image, it means “don’t let the image grow to be bigger than it’s native pixel dimensions”. On the other hand,width:100%
would be interpreted at “make the image match the width of it’s container”. This is rarely desired, as it can result in very low-resolution graphics. -
width:auto
is used to override thewidth
attribute of the<img>
tag. Because we are using themax-width
property to set the image size, no value other thanauto
makes any sense. -
height:auto
is used to ensure support in IE8. Otherwise, IE tends to flatten the images to a 1px high pancake, at least in my test: http://calebgrove.com/articles/flexible-width-images
freewaytalk mailing list
email@hidden
Update your subscriptions at: