<!DOCTYPE html>
<html>
<head>
<style>
#container {
position: relative;
width: 60%;
aspect-ratio: 2/3;
margin: auto;
border: solid black 2px;
}
#topDiv {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 25px;
z-index: 1;
background-color: rgba(0, 0, 0, 0.8);
color: white;
}
#imgDiv {
position: absolute;
inset: 0 0 0 0;
padding-bottom: 40px;
overflow-x: hidden;
overflow-y: scroll;
scroll-snap-type: y mandatory;
scroll-padding-bottom: 30px;
}
#imgDiv > img {
width: 95%;
margin: 2px;
scroll-snap-align: end none;
}
</style>
</head>
<body>
<h3>CSS scroll-padding-bottom property.</h3>
<p>Scroll inside the photo gallery box, stop scrolling, and see the scroll-snap effect with snap position end and scroll-padding-bottom 30px. The effect of the scroll-padding-bottom property value is that the images are offset above the fixed top element.</p>
<div id="container">
<div id="topDiv">Fixed bottom element</div>