Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7907415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:25:19+00:00 2026-06-03T11:25:19+00:00

I have a long list of elements which I would like to scroll while

  • 0

I have a long list of elements which I would like to scroll while keeping the rest of the page static around it.

<header>
  <!-- the header is stuck to the top of the page -->
</header>
<ul class="list">
  <!-- long list of stuff which should scroll -->
  <li></li>
  <li></li>
  <li></li>
  <li></li>
  <!-- ... and so on, hundreds of elements -->
</ul>
<footer>
  <!-- the footer is stuck to the bottom of the page -->
</footer>

Now this seems to work as long as I set a height on the <ul>.

ul.list {
  overflow: auto;
  height: 700px;
}

The problem is that if the user’s browser is taller than 700px + [header height] + [footer height] then ul.list won’t take up all of it’s available space. There is a gap between the list an the footer. Conversely, if the user’s browser is smaller than 700px, some of the list elements are hidden off the bottom of the page.

How can I make the list take up all of the available height?

The only way I can think of so far is to detect the $header.offset() and $footer.offset(), subtract them to get the distance between them and set the height of the ul everytime the window resize event is triggered. This seems like an overly complicated solution to what seems like it should be a simple problem. Is there a better way?

By the way, this is the styling I have applied to make the fotter stick to the bottom of the page.

footer  {
  // stick the footer to the bottom of the page
  position: fixed;
  bottom: 0px;
  left: 0;
  right: 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:25:20+00:00Added an answer on June 3, 2026 at 11:25 am

    If you know know the height of the header and footer and can absolutely position the list, it’s simple enough:

    ul.list {
      overflow: auto;
      position: absolute;
      top:    [height of header]px;
      bottom: [height of footer]px;
    }
    

    If you want the list to have a fixed width, and keep it centered, you can do:

    ul.list {
      overflow: auto;
      position: absolute;
      top:    [height of header]px;
      bottom: [height of footer]px;
    
      left:  50%;      
      width: 600px;  /* as an example */
      margin-left: -300px; /* negative half of the width */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have a list of elements: [{dog,1},{dog,2},{cat,1},{cat,2},{bird,1},{bird,2},...] I would like to store
My problem is simple: I have a long list of elements that I want
I have a Scheme macro and a long list, and I'd like to map
I have a list containing a tuples and long integers the list looks like
I have some page elements which are meant to appear in a two column
I have created a specific List which exists out of the following elements to
I have a list () in a table cell which elements contain a label
For example, the Meyer reset has a long list of elements 1 which I
I currently have a long list which is being sorted using a lambda function
I have a long list e2i, which maps rownames to values, and has duplicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.