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 710391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:36:55+00:00 2026-05-14T04:36:55+00:00

I’m trying to do a seemingly simple webpage layout, but I’m hitting a wall.

  • 0

I’m trying to do a seemingly simple webpage layout, but I’m hitting a wall.

I’d like to do everything purely with CSS (no tables to muck things up, and no javascript dynamically resizing things)

I’d like to have:

  • A heading with a fixed height
  • A footer with a fixed height
  • Left sidebar with a fixed width
  • Right sidebar with a fixed width
  • The whole layout always fills the entire viewport (i.e. if the user resizes the window, the layout grows to the new size)

Put another way:


|<                Total width is 100% of viewport             >|

+--------------------------------------------------------------+  ---
|                 Header with a fixed height                   |   ^
|--------+-------------------------------------------+---------+    
|        |                                           |         |    
|        |                                           |         |    
|  Left  |                                           |  Right  | Total
|  with  |        Center grows in height/width       |  with   | height
|  fixed |      and has scrollbars if necessary      |  fixed  | is
|  width |                                           |  width  | 100%
|        |                                           |         | of
|        |                                           |         | viewport
|        |                                           |         |  
|--------+-------------------------------------------+---------|   
|                 Footer with a fixed height                   |   v
+--------------------------------------------------------------+  ---

The parts that are giving me the most trouble are

  • Having the sidebars and center have a height equal to the height of the viewport minus the heights of the header and footer
  • Having the center have a width equal to the width of the viewport minus the widths of the two sidebars

I have no problem requiring users to have a modern browser.

I’m aware that similar questions to this have been asked before, such as

  • Make a div fill remaining space (http://stackoverflow.com/questions/1717564)
  • Three row tableless CSS layout with middle row that fills remaining space (http://stackoverflow.com/questions/1703455)
  • Create 2 divs, one takes up remaining space (http://stackoverflow.com/questions/1717564)

… and the conclusion seems to be that there isn’t a good solution. Those answers are somewhat old, so I’m hoping that someone knows the trick now.


Yes, I’m aware that this appears to be trivial to accomplish using a <table>, and after “banging my head against the wall” I did actually attempt to achieve the layout using a table. Unfortunately, with this approach, I have been unable to get the center section to show scroll bars (using overflow: auto) when the content grows too large.)

  • 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-05-14T04:36:56+00:00Added an answer on May 14, 2026 at 4:36 am

    how about THIS?
    it works with konqueror (KHTML), chrome (webkit) and firefox (gecko). like anything recent, it will probably barf under IE6.

        <html><body style="margin: 0; padding: 0;">
        <div style="position: absolute; background: #faa; 
                    height: 100px; top: 0px; width: 100%;">header</div>
        <div style="position: absolute; background: #afa; 
                    top: 100px; bottom: 100px; left: 0; width: 100px;">left</div>
        <div style="position: absolute; background: #afa; 
                    top: 100px; bottom: 100px; right: 0; width: 100px;">right</div>
        <div style="position: absolute; background: #faa; 
                    height: 100px; bottom: 0px; width: 100%;">footer</div>
        <div style="position: absolute; background: #aaf; 
                    bottom:100px; left: 100px;top: 100px;right: 100px; overflow: auto;">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam tincidunt tempor
     velit quis volutpat. Nulla pharetra pulvinar arcu sed lacinia. Nulla ultrices aliquet sem, 
    vitae commodo elit condimentum ut. Nulla consectetur facilisis nibh, et tempus purus 
    pellentesque nec. Ut eu nibh ut arcu mattis luctus. Cras at interdum quam. Pellentesque 
    imperdiet mi vitae felis sollicitudin iaculis. Maecenas accumsan tortor neque, at posuere 
    felis. Quisque ultricies mi quis dolor pellentesque elementum. Maecenas quis nunc tortor. 
    Cras eu velit faucibus nulla volutpat mollis. Aliquam fermentum lobortis diam ut pharetra. 
    Duis mattis posuere fringilla. Morbi consectetur mauris vel libero pellentesque varius. 
    Aenean leo enim, placerat a feugiat nec, ultrices et nulla. Etiam tincidunt urna id justo 
    molestie faucibus. Cras neque enim, semper et sodales eu, volutpat nec urna. Vestibulum 
    interdum arcu et ante egestas ut lacinia dui semper. Cras ligula lacus, aliquet nec dapibus 
    ac, commodo vitae libero. In gravida venenatis sapien a convallis.</p>
    
    
        <p>Nulla ac risus eu velit pulvinar pretium. Etiam porttitor viverra sollicitudin. 
    Donec lectus mi, posuere quis luctus facilisis, lacinia non ante. Sed sed mi neque. Etiam 
    neque risus, bibendum et tincidunt vel, pharetra nec risus. In hac habitasse platea 
    dictumst. Nam sollicitudin condimentum lorem, quis dignissim turpis sagittis nec. 
    Pellentesque diam nunc, rhoncus quis lobortis id, lacinia quis lorem. Maecenas tempor metus 
    nec velit facilisis in rhoncus lectus varius. Integer mollis, odio ut pharetra varius, elit 
    nulla pellentesque neque, a egestas est justo dapibus neque. Vivamus a mauris massa, sit 
    amet commodo orci. Aliquam nec iaculis sapien. Suspendisse ornare, tortor eget mattis 
    tempus, nulla ligula fermentum elit, vitae euismod odio metus ac risus. Etiam iaculis 
    dignissim consectetur. Nunc molestie lorem ac neque pulvinar vitae eleifend justo 
    facilisis.</p>
    
        <p>Duis a sem turpis, et cursus arcu. Suspendisse potenti. Sed eu risus orci, eget 
    bibendum justo. Praesent dapibus porttitor mauris, ac sollicitudin eros pretium quis. 
    Curabitur mi eros, aliquam et ultrices et, adipiscing ut mauris. Nunc pretium malesuada nisi 
    laoreet consectetur. Phasellus mi arcu, rutrum in blandit in, consectetur non risus. 
    Vestibulum enim lacus, aliquam eu ultrices a, tempor ut turpis. Lorem ipsum dolor sit amet, 
    consectetur adipiscing elit. Curabitur rhoncus faucibus sapien, quis vulputate eros tempus 
    consequat. Vivamus id metus massa. Vivamus aliquet enim quis sem viverra eu molestie elit 
    cursus.</p>
    
        <p>Mauris at lorem massa. Aliquam risus ligula, vestibulum et placerat condimentum, 
    pellentesque sit amet justo. Cras tempor sollicitudin ultrices. Aliquam sed elit sapien. 
    Praesent consectetur molestie vehicula. Pellentesque quis lectus et nunc accumsan feugiat. 
    Ut rhoncus aliquet libero sed rhoncus. Fusce egestas nunc eu elit vestibulum placerat. Class 
    aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. 
    Phasellus vitae nisi ante, id fermentum justo.</p>
    
        <p>Donec iaculis magna nec elit fringilla imperdiet. Proin mauris sem, pellentesque sed 
    ultrices ac, luctus ac elit. Donec blandit, orci ac volutpat luctus, turpis sem malesuada 
    tellus, eget porta magna nisi vitae quam. In vitae scelerisque urna. Proin ante odio, 
    ultrices lobortis scelerisque at, dictum non justo. Pellentesque tincidunt congue leo 
    malesuada ullamcorper. Quisque dapibus, massa dignissim gravida blandit, augue felis 
    vehicula urna, et ullamcorper turpis orci sit amet nibh. Ut vitae consequat nibh. 
    Pellentesque turpis justo, ultrices ac porta in, pretium quis quam. Donec purus nisi, 
    dignissim vitae hendrerit vel, hendrerit ac sapien. Fusce facilisis purus a libero elementum 
    ultrices. Nunc in libero congue ipsum tempor suscipit. Pellentesque pharetra pretium 
    volutpat. Nam sapien arcu, viverra vitae euismod sit amet, mollis nec arcu. Phasellus at 
    elit metus, sit amet tempus turpis. Phasellus mattis justo ut est varius facilisis ut et 
    leo. Phasellus congue cursus est eget luctus. In eleifend diam at enim ultricies a lacinia 
    mauris molestie. Nunc porttitor bibendum vulputate. Pellentesque quis risus vel mi 
    pellentesque imperdiet vitae ac nunc.</p>
    
        </div>
        </body></html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.