I've encountered an issue with the code below. It seems that when the title element is included, the content gets clipped at the bottom of the scroll. However, if I remove the title element, there is no cutoff of content. The positioning of the title element seems to disrupt the layout of the next element.
HTML
<div class="wrapper">
<div class="title">
Title
</div>
<div class="content">
Some lengthy content goes here...
</div>
</div>
CSS
.wrapper {
border: 0;
overflow: hidden;
position: fixed;
top: 50%;
left: 50%;
width: 50%;
height: 50%;
transform: translate(-50%, -50%);
}
.title {
text-align: center;
color: white;
padding: 5px 0;
position: relative;
margin: 0;
background: #000;
}
.content {
overflow-y: auto;
height: 100%;
}
Adding a box shadow and border radius to the wrapper element leads to some unexpected behavior (especially if overflow hidden is removed from the wrapper).