I don\'t understand how height percentages work.
Why is the following snippet not filled with color?
You need to set height: 100% to as well:
height: 100%
html,body { height:100%; } #div1 { height: 20%; background-color: red; } #div2 { height: 80%; background-color: blue; }