Sample code
body {
height: 100vh;
margin: 0;
display: flex;
flex-direction: column;
}
header,
footer {
background: green;
}
main {
flex: 1;
display: flex;
}
div {
flex: 1;
}
textarea {
width: 100%;
height: 100%;
border: 0;
padding: 0;
resize: none;
}
div#one textarea {
background: lightBlue;
}
div#two textarea {
background: tan;
}
<header>Header</header>
<main>
<div id="one"><textarea>Textarea 1</textarea></div>
<div id="two"><textarea>Textarea 2</textarea></div>
</main>
<footer>Footer</footer>
Issue
Remove the header
element, and there's no scrollbar; remove the footer
, and an extra scrollbar appears.
Question
Why does it happen only when you remove the footer
?
Note: I know how to get rid of the scrollbar.