Here's a different approach to achieving your objective by utilizing flexbox.
This...
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
... sets a baseline for all elements, eliminating the default margins that come with the <body>
tag and preventing vertical scrolling.
This...
html, body {
height: 100%;
}
... establishes the required height that will extend to child elements, enabling them to reach full height as well.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
}
.outerDiv {
display: flex;
height: 100%;
border: 4px solid red;
}
.innerDiv {
height: 100%;
width: 100%;
border: 4px solid blue;
}
<div class="outerDiv">
<div class="innerDiv">
test
</div>
</div>