I have a div
which is supposed to exactly fill the viewport, using height: 100vh
and width: 100%
, but (in Chrome and Safari at least), is slightly larger, so that scroll bars are generated. Why is this and how do I get the div I want? Example code is:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
<style>
.box {
height: 100vh;
width:100%;
border: 2px solid blue;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>