It displays several pixels on the page because you include a 5 pixel border. The body divis 100% of the page height, but borderis outside of this, adding a total height of 10 pixels per page along with a height of 100%. So, on a 1000px page, the height of your div will be 1010px. Remove the border and it will exactly match the height.
div {
height: 100%;
}
, , box-sizing: border-box, div
div {
height: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}