The outer div does not have any content to make it scroll, to make the html work we must make the outer div have some minimum height like
.header {
min-height: 1000px;
}
.baseheader {
position:sticky; top:0;
}
<div class="header">
<div class="baseheader">HEADER</div>
</div>
<p>some content 1</p>
<p>some content 2</p>
<p>some content 3</p>
<p>some content 4</p>
<p>some content 5</p>
<p>some content 6</p>
<p>some content 7</p>
<p>some content 8</p>
<p>some content 9</p>
<p>some content 10</p>
<p>some content 11</p>
The inner div will not pin to bottom unless a sibling element pushes it down so put a tag above it to push it down with a min-height
.header {
min-height: 1000px;
}
.baseheader {
position:sticky; bottom:0;
}
<div class="header">
<div style="min-height:1000px"></div>
<div class="baseheader">FOOTER</div>
</div>
<p>some content 1</p>
<p>some content 2</p>
<p>some content 3</p>
<p>some content 4</p>
<p>some content 5</p>
<p>some content 6</p>
<p>some content 7</p>
<p>some content 8</p>
<p>some content 9</p>
<p>some content 10</p>
<p>some content 11</p>
use the heights properly, if the total page height is 2000 or 3000, then only you will see the difference
so put some content below the main tag which make the screen really big more then 2000 px or more
When you keep scrolling the some content 1 to 10 will push the pinned item based on the screen or page height
Products
some text
– sumit saini Sep 04 '21 at 16:22