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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:29:53+00:00 2026-05-28T01:29:53+00:00

Sorry to have to ask this since there are many CSS 100% height questions

  • 0

Sorry to have to ask this since there are many CSS 100% height questions here (which I’ve read).

I’m to achieve a simple layout using DIVs instead of a TABLE. The first 3 rows are fixed height, the 4th row should expand and the fifth row should be a fixed size (at the bottom).

This is strait forward with a table, how can I do this with DIVs?

Here’s the TABLE version:

<html>
<head>

</head>
<body>

<table width="100%" height="100%" border="1">
    <tr height="20px">
         <td>
             fixed height 20
         </td>
    </tr>
    <tr height="50px">
         <td>
             fixed height 50
         </td>
    </tr>
    <tr height="100px">
         <td>
             fixed height 100
         </td>
    </tr>
    <tr>
        <td>
            auto expanding height
        </td>
    </tr>
    <tr height="50px">
        <td>
            fixed height 50
        </td>
    </tr>
</table>
</body>
</html>

Here’s my best attempt so far which doesn’t work.

<html>
<head>
</head>
<body>

<div style="width: 100%; height: 100%; border-width: 2px; border-style: solid;">

    <div style="height: 20px; border-width: 2px; border-style: solid">
        fixed height 20
    </div>

    <div style="height: 50px; border-width: 2px; border-style: solid">
        fixed height 50
    </div>

    <div style="height: 100px; border-width: 2px; border-style: solid">
        fixed height 100
    </div>

    <div style="border-width: 2px; border-style: solid;">
        Auto expanding?
    </div>

    <div style="height: 50px; border-width: 2px; border-style: solid">
        fixed height 50
    </div>
</div>
</body>
</html>
  • 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-28T01:29:53+00:00Added an answer on May 28, 2026 at 1:29 am

    Divs stack up automatically so all you have to do is hand them a height and you should be all set. Try this:

    HTML

    <div class="container">
        <div class="twenty">
            fixed height 20
        </div>
        <div class="fifty">
            fixed height 50
        </div>
        <div class="hundred">
            fixed height 100
        </div>
        <div class="auto">
            <div class="content">
                ....
            </div>
        </div>
        <div class="fifty" style="border-bottom:none; border-top:1px solid">
            fixed height 50
        </div>
    </div>
    

    CSS

    html,body {
        height:100%;
        margin:0;
        padding:0;
        overflow:hidden;
    }
    
    .container {
        width:100%;
        height:100%;
    }
    
    .twenty, .fifty, .hundred, .auto {
        border-bottom:1px solid black;
    }
    
    .twenty {
        height:20px;
    }
    
    .fifty {
        height:50px;
    }
    
    .hundred {
        height:100px;
    }
    
    .auto {
        height:100%;
        overflow:hidden;
        -webkit-box-sizing:border-box;
        -moz-box-sizing:border-box;
        -ms-box-sizing:border-box;
        box-sizing:border-box;
        margin:-120px 0;
        padding:120px 0;
    }
    
    .content {
        float:left;
        overflow:auto;
        height:100%;
    }
    
    .content{
        width:100%;
    }
    

    EDIT Updated answer for future reference. Now the container completely fills the width and height of the document and just scrolls the scrollable portion of the page while keeping the sections that OP wanted available.

    Full view: http://jsfiddle.net/8abeU/show/
    Fiddle: http://jsfiddle.net/8abeU

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry, this's my first time to ask a question here. So, I don't have
I'm sorry to ask this here since I'm sure it must be answered out
I'm sorry to ask this again, I've looked over all the related questions here,
I'm really sorry to have to ask this, but I clearly don't understand something
I'm sorry to ask this question but I have spent hours trying to understand
Sorry to flood so many questions this week. I assume thread index returned by
hi guys sorry to ask this one again but i have some jquery that
sorry to have to ask, but I don't know what this term means, and
Sorry if this is a dumb way to ask this... I have a generic
I am really sorry to ask this silly question. I have been onto this

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.