[Pro] Responsive image problem with cms

Ernie,

A few things about the code:

  1. 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.

  2. width:auto is used to override the width attribute of the <img> tag. Because we are using the max-width property to set the image size, no value other than auto makes any sense.

  3. 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: