I’m trying to set a height of my div so that it can be scrolled down and completely hidden at the top. So the height of element would have to be something like calc(parent_padding_top + max-content + 100vh)
, right? The idea is that I want to scroll just enough so that’s completely hidden, but not really any further. Is there a way to do this?
.section {
background-color: red;
height: 200px;
min-height: 200px;
max-height: 200px;
width: 200px;
padding: 20px;
overflow: scroll;
}
.content {
display: block;
background-color: transparent;
height: 200%;
}
<div class="section">
<div class="content">
<p>This is some text, we don't really know how long that text will be, but it can be either very short or realy, really long</p>
</div>
</div>