Quote:
Originally Posted by Jellby
That is the height and width HTML attributes of the <img> element. It doesn't change how CSS properties work, I guess.
Height of the containing element (and therefore the reference for % in height) is often undefined, and the result can vary from reader to reader. However, specifying max-height should never make the image larger than leaving it out, although it could make it smaller (and smaller than intended, in some cases).
|
Correct.
You can still define height and width of the container using percentages - although as you point out height doesn't have much affect on a <div>.
The problem this lack of % handling in the <img> brings up is that you can't make an image display LARGER than it's actual dimensions unless you wrap it in an SVG, or define it as a background image and use some css3 to "contain" it...at least I haven't found a way yet.
What cases have you seen that height:100% would cause the image to appear smaller than intended?? Is that something I should worry about?