mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
69 lines
1.3 KiB
HTML
69 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<style>
|
|
.wrapper {
|
|
position: relative;
|
|
width: 400px;
|
|
height: 200px;
|
|
border: 5px solid red;
|
|
}
|
|
|
|
.scrollable-container {
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow-y: scroll;
|
|
}
|
|
|
|
.outer-sticky {
|
|
position: absolute;
|
|
top: 0px;
|
|
left: 0px;
|
|
width: 350px;
|
|
height: 100px;
|
|
background: #3498db;
|
|
z-index: 1;
|
|
}
|
|
|
|
.inner-sticky {
|
|
position: absolute;
|
|
top: 30px;
|
|
left: 0px;
|
|
width: 200px;
|
|
height: 40px;
|
|
background: #e74c3c;
|
|
}
|
|
|
|
.orange-content {
|
|
position: absolute;
|
|
top: 100px;
|
|
left: 0px;
|
|
width: 385px;
|
|
height: 100px;
|
|
background-color: orange;
|
|
}
|
|
|
|
.spacer {
|
|
height: 300px;
|
|
background-color: orange;
|
|
}
|
|
|
|
.fill-space {
|
|
height: 100px;
|
|
}
|
|
</style>
|
|
|
|
<div class="wrapper">
|
|
<div class="scrollable-container" id="container">
|
|
<div class="spacer"></div>
|
|
<div class="fill-space"></div>
|
|
<div class="spacer"></div>
|
|
</div>
|
|
<div class="outer-sticky">
|
|
<div class="inner-sticky"></div>
|
|
</div>
|
|
<div class="orange-content"></div>
|
|
</div>
|
|
|
|
<script>
|
|
document.getElementById("container").scrollTop = 320;
|
|
</script>
|