I have a div.content
of variable height that's inside a scrollable fixed-height div.content-wrapper
.
I want div.content
to be at least 1px taller than div.content-wrapper
, so that rubberband scrolling works on iOS.
This works well: https://jsbin.com/tonotenamo/edit?html,css,output
However, once I remove the border from div.content
, it grows to be much taller than 1px taller than div.content-wrapper
.
Any ideas how to fix this?
PS: This does not happen, when I remove p { margin: 50px 0 }
.
div, p {
margin: 0;
padding: 0;
}
div.content-wrapper {
height: 300px;
overflow-y: scroll;
background: rgb(255, 0, 0, .1);
}
div.content {
min-height: calc(100% + 1px);
border: 1px solid blue; // Remove this and div.content becomes too tall
}
p {
margin: 50px 0
}
HTML:
<div class="content-wrapper">
<div class="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Itaque quod, perspiciatis similique esse consectetur voluptate veniam modi dolor deleniti amet. Sequi rerum harum ad molestias itaque culpa, dolores consequatur dignissimos.</p>
</div>
</div>