The main cause for the overflow of letters in the div is due to using vh, which represents 1% of the currently displayed height. Setting the height to 100vh makes it equal to 100% of the current screen's length. In this specific example, the CSS is defined as calc(100vh - 62px), meaning it is set to the current viewed height minus 62 pixels. Even with a screen size of 1920 * 1080, the example CSS still causes an overflow of text content. overflowed
In order to keep the letters inside the tag, it is essential to apply appropriate scripting.
<style>
#test {
background-color: red;
border: 10px solid yellow;
margin: 20px;
}
</style>
<body>
<div id="test">
put text here
</div>
<script>
//Get id
let div = document.getElementById('test')
//It's the height of whole screen
let height1 = document.body.clientHeight
div.style.height = height1 + 'px'
</script>
<body/>