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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:08:07+00:00 2026-06-18T02:08:07+00:00

I have several divs and i need them to fill content height so that

  • 0

I have several divs and i need them to fill content height so that every div has the same height. Their height must respond to browser window resizing, so it can’t be fixed. Number of divs can vary between 7 and 12.
I don’t know if this can be done with pure css or jquery must be involved.

Before:
original divs http://imageshack.us/a/img14/9964/23446096.jpg

After:
resized divs http://imageshack.us/a/img42/9183/76164750.jpg

  • 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-18T02:08:08+00:00Added an answer on June 18, 2026 at 2:08 am

    This wasn’t nearly as bad as I thought. See code below:

    HTML

    <html>
    <head>
        <title>Test divs</title>
    </head>
    <body>
        <div id="header">Head</div>
        <div id="content">
            <div id="div1">Div 1</div>
            <div id="div2">Div 2</div>
            <div id="div3">Div 3</div>
            <div id="div4">Div 4</div>
            <div id="div5">Div 5</div>
        </div>
        <div id="footer">Footer</div>
    </body>
    

    CSS

    body, html {
        height: 100%;
    }
    
    body, body * {
        margin: 0;
        padding: 0;
    }
    
    #header, #content, #footer, #div1, #div2, #div3, #div4, #div5 {
        border: 1px solid black;
    }
    
    #content {
        position: relative;
        height: 80%;
    }
    
    #div1, #div2, #div3, #div4, #div5 {
        position: absolute;
        right: 0;
        height: 20%;
        width: 150px;
    }
    
    #div1 {
        top: 0;
    }
    
    #div2 {
        top: 20%;
    }
    
    #div3 {
        top: 40%;
    }
    
    #div4 {
        top: 60%;
    }
    
    #div5 {
        top: 80%;
    }
    

    (Borders for visual reference only) Adjust the height and top positions of the divs according to how many divs there are (100% / number of divs, starting from 0). According to a comment on this question, it doesn’t work in IE8, but I have no way of testing that at the moment. Confirmed working in IE9, IE9 with Compatibility Mode, Chrome 24, and FF 18.

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

Sidebar

Related Questions

I have a container that has several divs with content. i need to be
I have a design that has several divs at varying widths/heights and I need
I have several divs like this <div rel=5> Divs content goes here </div> <div
I have a container DIV which contains several block-DIVS. Every block-DIV contains SPAN items
I have a DIV container with several inner DIVs layed out by floating them
You need to have several 200px wide DIVs (.item) inside a 620px wide DIV
I have several divs on a page. Each div has a heading which I
I have several divs that are alerts. The user dismisses them and after the
So, I have two DIVs, being that the second one has variable content. I
I have several divs that share a common class. If one of these divs

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.