I set up a very simple webpage using css and html and I get an unwanted vertical scrollbar. I do not get why the scrollbar appears. When I inspect my Webpage with DevTools in Fullscreen (Google Chrome) my body has a height of 1080px (my exact Monitor height) and the Div also has a height of 1080px so I see no need for the scrollbar but it is still there. I know that I can fix the problem with overflow: hidden ,but I want to know why the scrollbar appears in the first place.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="stylesheet" href="styles.css">
<title>Frontend Mentor | Interactive card details form</title>
</head>
<body>
<div class="left bgbox"></div>
<div class="right bgbox"></div>
</body>
</html>
CSS
*,
*::before,
*::after {
margin: 0;
padding: 0;
}
body {
height: 100vh;
}
.box {
display: inline-block;
height: 100%;
margin: 0;
padding: 0;
width: 30%;
} I also made a Codepen : https://codepen.io/theknax-dev/pen/MWGYpxJ