views:

64

answers:

2

When does it make sense to use max-height or max-width on an image?

Does it help if I don't specify the actual dimensions of the image because I don't know it.

A: 

it also a good practice to hold the size of an image list that contains landscape and portrait format

antpaw
+1  A: 

It makes sense when you have images of unknown width (for example, user uploaded content) that you do not want to exceed a certain area.

If I remember correctly, the property is not supported by IE6. It is however by IE7: Source

Pekka
Assuming the actual image dimensions are not specified, does the web browsers HTML render first allocate an image placeholder equal to the size of the max-height and max-width? If so, that would be great and then - once the browser knows the actual image dimensions - size appropriately
JasonK
I don't know, but it would hardly make sense, would it? In most cases, the image will be smaller than the max- value, and all the placeholding was for naught.
Pekka