The text content is overflowing the line box. You can see this if you add some span
with outline or border:
#container {
width: full;
height: 200px;
background: #ffaaaa;
overflow: auto;
}
.content {
background: #aaffaa;
font-size: 8rem;
line-height: 1;
}
.content span {
border: 1px solid;
}
<div id="container">
<div class="content"><span>CONTENT</span></div>
<div class="content"><span>CONTENT</span></div>
<div class="content"><span>CONTENT</span></div>
</div>
You can clearly see how the border is overflowing. The reason is related to the line-height: 1
that set the height of the line box to something smaller than the text content
Don't do it. You can control the height of a line box but not the height of the text content. Keep the default line-height
or use a bigger value
#container {
width: full;
height: 200px;
background: #ffaaaa;
overflow: auto;
}
.content {
background: #aaffaa;
font-size: 8rem;
/*line-height: 1;*/
}
.content span {
border: 1px solid;
}
<div id="container">
<div class="content"><span>CONTENT</span></div>
<div class="content"><span>CONTENT</span></div>
<div class="content"><span>CONTENT</span></div>
</div>
Related: Can specific text character change the line height?