Set the height of the body
and html
to 100%, then set each element to the height you want. Add in overflow: hidden
to prevent growing of the divs. Vertical margins will ruin this layout, so use padding.
CSS:
body, html {
height: 100%;
}
.top {
height: 33.3333%;
overflow: hidden;
background: blue;
}
.bottom {
height: 66.6666%;
overflow: hidden;
background: green;
}