I am trying to create a div boundary that fits snugly inside the entire window (also in JSFiddle):
<!doctype html>
<html>
<head>
<script type='text/javascript'>
function setupDiv() {
document.getElementById('div')
.setAttribute('style'
, 'position: absolute; top: 30px; left: 0px; width: '
+window.innerWidth +'px; height: '
+window.innerHeight+'px; border: 1px solid #ff0000');
}
window.onload = setupDiv;
</script>
</head>
<body>
<div id='div'>
</div>
</body>
</html>
Unfortunately the above code results in both horizontal and vertical sliders and only the "north" and "west" border lines are visible. While I can of course reduce the values manually I would like to understand why is that.