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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:28:26+00:00 2026-05-20T11:28:26+00:00

I tried this with DIVs. The problem occurs in both. I can’t get the

  • 0

I tried this with DIVs. The problem occurs in both. I can’t get the right border to be equal heights as the longest DIV. And I need this to work across the current desktop browsers from the days of IE7 and up.

This is a common problem, but it’s 2011 now when I write this. Is there finally a way to do this with pure cross-platform CSS without resorting to funky tricks like pretending to make it work (such as a column cutoff)? Or, must I resort to jQuery to make it work in the least amount of fuss?

EDIT: My bad. When I wrote this originally, I included TABLE TDs having the problem as well as DIVs. But I didn’t realize that I had taken my test code and switched from DIV to TD, but my CSS still said float:left;clear:right. When I eliminated that with the TDs, the border extended to full height of the longest column. However, still, it would be good to find out how to do this with DIVs, but cross-platform from desktop browsers starting with the year IE7 came out and upwards.

  • 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-20T11:28:27+00:00Added an answer on May 20, 2026 at 11:28 am

    This approach is relatively “trickless” — and it’s the only approach I’ve found that works correctly, and doesn’t involve any big-time hacks. (also, no tables – only divs and css).

    You can see the following example in action: here (jsFiddle)

    HTML:

    <div class="colwrap">
        <div class="col1 content">
            <div class="col1 bg"></div>
            unde omnis iste natus error 
            sit voluptatem accusantium 
            doloremque laudantium
        </div>
        <div class="col2 content">
            <div class="col2 bg"></div>
            abcdefg hijklmnop
        </div>
    </div>
    

    CSS:

    .colwrap {
        position: relative;
        overflow: hidden;
    }
    .colwrap .content {
        float:left;
        overflow: hidden;
    }
    .colwrap .bg {
        position: absolute;
        height: 100%;
        z-index: -1;
    }
    .colwrap .col1 { width: 50px; }
    .colwrap .col1.bg { background: blue; }
    
    .colwrap .col2 { width: 50px; }
    .colwrap .col2.bg { background: red; }
    

    Notes

    1. The only trick here, is that you have to split your background (or border) — whatever visual element you want to fill the column with–into a separate div from the content.

    2. Your columns must be fixed-width. percentage widths usually won’t work out very well.

    3. The content divs float within the wrapper, which is set to overflow:hidden. This way the content divs “push out” the wrapper to the full height of the largest content.

    4. Then the background divs are position:absolute; height:100%;. They automatically inherit the position (top,left) of their floating parents, but the height is computed based on the next positioned parent (not the floating content div, but the wrapper, with position:relative;). So the background divs end up right where we want.

    5. The bg divs also use z-index:-1; to force them behind the content. This works in webkit, and FF, but may not work correctly in IE (esp. older versions). If it doesn’t work, the problem is likely the negative number. To fix it all you have to do, is add an additional wrapper around the text within the content div, then set z-index on bg and on your content wrapper, so that things stack the way you want. (of course, you should test it — because it may not be a problem at all).

    6. Finally, I’ll note that this same approach will work for as many columns as you want — just add more (.col3, .col4, and so on.), just like col1 and col2 shown above.

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

Sidebar

Related Questions

I've tried this both with and without the 'ExceptionType' parameter. I have an Error.aspx
I've honestly tried this left and right and still find that my mirror server,
This previous Q about a div positioning problem in IE gave several answers where
In my site, I have two divs - right and left. Both are contained
I tried this XAML: <Slider Width=250 Height=25 Minimum=0 Maximum=1 MouseLeftButtonDown=slider_MouseLeftButtonDown MouseLeftButtonUp=slider_MouseLeftButtonUp /> And this
I tried this: ALTER TABLE My.Table DROP MyField and got this error: -MyField is
I tried this but it does not seem to be valid syntax. <xsl:element name=$myElementName></xsl:element>
I've tried this: string newScript = textBox1.Text; HtmlElement head = browserCtrl.Document.GetElementsByTagName(head)[0]; HtmlElement scriptEl =
I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is
Have you ever tried this before? static void Main(string[] args) { int x =

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.