Check out this JSFiddle link for more details
<div class="navbar">
navbar
</div>
<section>
<header>header</header>
<div class="chat">
chat window
</div>
<footer>
<textarea>chat enter</textarea>
</footer>
</section>
css:
* {
box-sizing: border-box;
padding: 0;
margin: 0;
border: 1px solid gray;
}
.navbar {
height: 2rem;
}
section {
height: calc(100vh - 2rem);
}
.chat {
background-color: green;
height: 100%;
}
The goal is to ensure that the content fits perfectly within the viewport size without any overflow on different window sizes.