.browser
.parent(style="overflow: hidden")
.children.is__sticky Parent with overflow: hidden
.children
.parent
.children.is__sticky Parent with overflow: visible
.children
View Compiled
.parent {
width: calc(100% / 2 - 10px);
box-shadow: inset 0 0 1px #000;
margin: 50px 0;
}
.children {
height: 600px;
padding: 10px;
font-size: 16px;
text-align: center;
color: rgba(26, 115, 232);
}
.is__sticky {
position: sticky;
top: 10px;
height: auto;
background: rgba(26, 115, 232, 0.15);
}
.browser {
overflow: scroll;
height: 380px;
margin: 10px;
border: 1px solid rgba(0,0,0,.08);
border-radius: 4px;
border-top-width: 25px;
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.browser::after {
content: '↓ Scroll inside ↓';
position: absolute;
top: 13px;
left: 0;
width: 100%;
font-size: 16px;
text-align: center;
color: #000;
opacity: .4;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.