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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:18:32+00:00 2026-05-25T15:18:32+00:00

My HTML is as follows: <div id=list-container> </div> <div id=button-container> </div> And the CSS

  • 0

My HTML is as follows:

<div id="list-container"> </div>
<div id="button-container"> </div>

And the CSS for these two divs:

#button-container {
    float: right;
    width: 100px;
    height: 100%;
    background-color: #f5f5f5;
}

#list-container {
    float: left;
    height: 100%;
    background-color: #FAD275;
}

Both of these divs are side-by-side and have the same height. The button-container div is on the right and must have a fixed width of 100px. The left div, however, named list-container needs to have a width equal to the remaining space allocated by the parent container. So for example, if my parent div has a width of 400px, and the button-container div takes up 100px of that, then I should be able to specify something like height: 100% for the list-container div and have that equal to a width of 300px.

The absolute #1 rule is that I cannot set a fixed width for the list-container div. The parent div for this whole thing is dynamically resizable, so every child underneath it must be designed to resize with it, hence why this question exists.

Keep in mind that this is all being done in a Google Chrome extension, so I have access to HTML5 and CSS3. I also don’t need to worry about cross-browser support. I only want this to work in Chrome.

Can anyone help me figure out how to make list-container fill the remaining space of the parent container without using a fixed width?

  • 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-25T15:18:32+00:00Added an answer on May 25, 2026 at 3:18 pm

    You can use the CSS property display: table; and display: table-cell;.

    This mimics the way a table handles its rows, but applies it to divs.

    You’ll need a wrapper div, but that’s all the extra markup you’ll need.

    HTML

    <div class="wrap">
    <div id="list-container">list container </div>
    <div id="button-container">button container </div>
    </div>
    

    CSS:

    .wrap
    {
        display: table;
        width: 100%;
        height: 100%;
    }
    
    #button-container {
        display: table-cell;
        width: 100px;
        height: 100%;
        background-color: #f5f5f5;
    }
    
    #list-container {
        display: table-cell;
        height: 100%;
        background-color: #FAD275;
    }
    

    See my example here.

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

Sidebar

Related Questions

I have a basic unordered list in HTML/CSS as follows... <div class=floatleft> <ul class=help>
If I have a drop down list as follows <div class=editor-label> <%= Html.DropDownListFor(model =>
My tool tip code is as follows: HTML/CSS a.tooltip span { display: none; padding:
I have a CSS style using child selectors in an HTML page as follows:
I have a HTML structure like follows <div id=answer-1> <a class=edit></a> </div> <div id=answer-2>
I've got a HTML list, <div id=wrapper> <ul id=twitter> <li id=titleTile> <a href=# alt=Our
I have the following css. #lll { float:left; max-width:1000px; border:1px solid; } #rrr {
My HTML is as follows: <ul id=nav> <li><a href=./>Home</a></li> <li><a href=/About>About</a></li> <li><a href=/Contact>Contact</a></li> </ul>
I have a html form for uploading a file, which is as follows: $uploadhtml
Suppose I am retrieving a url as follows: string url = http://www.somesite.com/somepage.html HttpWebRequest req

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.