There are two different ways, that I know of, to do this. As wolfcry911 said, you need to set the html/body height if you want to fill the visible page (demo).
Method 1 – padding/margins must be zero or it goes beyond screen height
html, body {
height: 100%;
padding: 0;
margin: 0;
}
div {
height: 100%;
padding: 0;
margin: 0;
}
Method 2 – padding allowed; adjust position (top, left, right, bottom) to add margin
html, body {
height: 100%;
padding: 0;
margin: 0;
}
div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 20px;
}