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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:27:20+00:00 2026-06-11T19:27:20+00:00

Possible Duplicate: 2 divs in a larger div must equal the same height… but

  • 0

Possible Duplicate:
2 divs in a larger div must equal the same height… but how?

I’m having trouble auto setting the height of my containerLeft div (red background) the same height as my containerRight div. I specifically want this to stay a fluid grid.

jsfiddle here: http://jsfiddle.net/s7ufg/

  • 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-11T19:27:22+00:00Added an answer on June 11, 2026 at 7:27 pm

    If you know that one of the two columns is always going to be taller than the other, then you can do something like this:

    demo

    Just give position: absolute to the shorter column and make it stretch from top: 0 to bottom: 0.

    HTML:

    <div class='container'>
        <div class="containerLeft">
            <h2>1.</h2>
            <p>First, let's play a video.</p>
        </div>
        <div class="containerRight">
            <img src="http://tctechcrunch2011.files.wordpress.com/2012/09/michael-headshot-red.jpg?w=288" />
        </div>
    </div>​
    

    CSS:

    .container { position: relative; }
    .containerLeft { /* shorter column */
        position: absolute;
        top: 0; bottom: 0; left: 0;
        width: 38%;
        padding: 2%;
        background-color: crimson;
    }
    .containerRight { /* taller column */
        margin: 0 0 0 42%;
        width: 58%;
        background: dodgerblue;
    }​
    

    If you don’t know for sure which one of them is going to be taller, then you can simulate the fact that they are of equal height by using a background gradient on their parent.

    demo

    HTML is the same, CSS becomes:

    .container {
        overflow: hidden;
        background: -webkit-linear-gradient(left, crimson 42%, dodgerblue 42%);
        background: -moz-linear-gradient(left, crimson 42%, dodgerblue 42%);
        background: -o-linear-gradient(left, crimson 42%, dodgerblue 42%);
        background: linear-gradient(left, crimson 42%, dodgerblue 42%);
    }
    .containerLeft, .containerRight { float: left; }
    .containerLeft {
        width:38%;
        padding: 2%;
    }
    .containerRight { width: 58%; }​
    

    However, CSS gradients don’t work in IE9 and older, so if you want a solution for IE8+, then you can try this

    demo

    which uses :before and :after pseudo-elements.

    .container {
        overflow: hidden;
        position: relative;
    }
    .container:before,.container:after {
        position: absolute;
        z-index: -1;
        top: 0; bottom: 0;
        content: '';
    }
    .container:before {
        left: 0;
        width: 42%;
        background: crimson;
    }
    .container:after {
        right: 0;
        width: 58%;
        background: dodgerblue;
    }
    .containerLeft, .containerRight { float: left; }
    .containerLeft {
        z-index: 2;
        width:38%;
        padding: 2%;
    }
    .containerRight { width: 58%; }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: CSS - Equal Height Columns? I have 3 divs. Like this: <div
Possible Duplicate: CSS - Equal Height Columns? I'm not the greatest with css, so
Possible Duplicate: Wrap every 3 divs in a div First thing, i know i
Possible Duplicate: click link below a higher z-index div I have two divs, one
Related (possibly duplicate) questions : How do I achieve equal height divs with HTML
Possible Duplicate: Mouseout on specified divs and keep original div open I asked a
Possible duplicate: jquery change div text The above question is a possible duplicate, but
Possible Duplicate: jQuery: Sort div's according to content of different sub divs Is it
Possible Duplicate: $(this) doesn't work in a function Im having a problem targeting the
Possible Duplicate: Change an element's CSS class with JavaScript I'm trying to set div's

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.