I have a long list of items that I would like to scroll through while preserving the rest of the page.
<header>
</header>
<ul class="list">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<footer>
</footer>
Now it works as long as I set the height to <ul>.
ul.list {
overflow: auto;
height: 700px;
}
The problem is that if the user's browser is higher 700px + [header height] + [footer height], then ul.listit will not take up all the free space. Between the list there is a footer. Conversely, if the userβs browser is smaller than 700pxthat, some list items are hidden at the bottom of the page.
How can I make a list occupying all available height?
, , - $header.offset() $footer.offset(), , ul resize, , , , . ?
, , , .
footer {
position: fixed;
bottom: 0px;
left: 0;
right: 0;
}