I'm attempting to do a very simple full-screen grid with CSS.
Here's only the relevant code:
html, body {
height: 100%;
padding: 0;
margin: 0;
font-size: 0;
}
[class*='col-'] {
display: inline-block;
height: 100%;
background-color: red;
}
.row-third {
height: calc(100% / 3 - 1.333333333333333%);
}
.row-third:nth-child(n+2) {
margin-top: 2%;
}
.col-third {
width: calc(100% / 3 - 1.333333333333333%);
}
.col-third:nth-child(n+2) {
margin-left: 2%;
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="responsive.css"></link>
</head>
<body>
<div class="row-third">
<div class="col-third">
</div>
<div class="col-third">
</div>
<div class="col-third">
</div>
</div>
<div class="row-third">
<div class="col-third">
</div>
<div class="col-third">
</div>
<div class="col-third">
</div>
</div>
<div class="row-third">
<div class="col-third">
</div>
<div class="col-third">
</div>
<div class="col-third">
</div>
</div>
</body>
</html>
The issue is that even though the total height of the 3 divs adds up to 100% the scrollbar appears. I don't want the scrollbar to show and overflow: hidden;
would not fix things only hide the fact that the grid is going off-screen. Why would the grid be going off screen if it's supposed to be 100% in height?
I feel like I'm taking crazy pills.