View Single Post
Old 03-03-2013, 03:05 PM   #13
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Jellby View Post
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?
Turtle91 is offline   Reply With Quote