Deeven Deeven - 1 year ago 79
CSS Question

purpose of setting height to 100% for body and html

html, body {
height: 100%;
} {
height: auto;
width: auto;

img.two {
height: 50%;
width: 50%;

In the css above, when I take out the height property of body and html something seems to happen but I don't understand what.
What is the purpose of setting the height to 100% for body and html?

Answer Source

If you remove the height from html, body then img.two { height: 50%; } has no reference height any more. 50% of what should it then be?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download