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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:00:55+00:00 2026-06-03T03:00:55+00:00

Update – I’ve decided against the JavaScript solution. The only way to make sure

  • 0

Update – I’ve decided against the JavaScript solution. The only way to make sure it always works is to put it in setInterval() going every few seconds. Don’t want to do that. I know this CSS is possible, I’ve seen it work. I’ll re-open the bounty for more like 150 if it ends.


I have a modal popup made up of two sections: left and right. Within both sections are a label above and the content below. The label is fixed at a certain number of pixels, but the bottom area needs to be able to fill the remaining space, so I’m using display:table on the left and right sides and display: table-cell on the inner sections to achieve the “fill remaining space” effect. It works great in Chrome and Safari.

Here’s the CSS:

#tagBoxLeft,#tagBoxRight {
    display: table;
    height: 100%;
    width: 50%;
    position: absolute;
    right: 0;
    opacity: 0;
}
#tagBoxLeft { left: 0 }
#tagBoxDescription {
    display: table-row;
    -webkit-border-top-left-radius: 20px;
    width: 100%;
    word-break: break-all;
    word-wrap: break-word;
    -webkit-box-shadow: 0 1px 0 #FFF;
    -moz-box-shadow: 0 1px 0 #FFF;
    box-shadow: 0 1px 0 #FFF;
}
.nano {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: table-cell;
}
#taglabel {
    display: table-row;
    z-index: 10000;
    border-top: 1px solid #FFF;
    width: 100%;
    height: 39px;
}

And it just makes a bunch of divs into a table so they can have heights that are relative to each other. Also notice that the left and right sides are relative to the browser window, so that’s why I can’t just use percentages.

However, in Firefox and Opera, the #tagBoxLeft and #tagBoxRight sides sections refuse to accept height:100%; while they have display:table;. So it won’t force the bottom sections up responsively.I know Firefox & Opera support this normally (see http://jsfiddle.net/Qxswa/). But why does all my content overflow in Firefox and Opera?

Here’s a screenshot of the issue:

enter image description here

  • 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-03T03:00:56+00:00Added an answer on June 3, 2026 at 3:00 am

    Here’s an alternative to using display:table and friends, which uses the oft-neglected ability of absolutely positioned elements to have both their top and bottom (and left and right) values set. It essentially ‘sticks’ the top and bottom edge, giving you a height relative to a container, but without explicitly setting a height.

    UDPATED: As Jackson mentioned, the CSS-only version of this code doesn’t provide an auto-height, fixed panel in the column. A simple bit of JS will fix that – you’d just need to set a sensible default height for users without JS. The JS only needs to run when you load the modal, not at intervals.

    Here’s the updated fiddle: http://jsfiddle.net/cxY7D/5

    and here’s the simplified HTML:

    <div id="modal">
          <div class="left">
              <div class="description">
                <h1>#tag_name</h1>
                <dl>
                 <dt>Tags</dt> <dd>27</dd>
                </dl>
              </div>
              <div class="contents">
                <div class="header">            
                  <h2>Featured</h2>
                </div>
                <ol>
                  <li>Something Something</li>
                  <li>...</li>
                </ol>
              </div>
          </div>
          <div class="right">
            <div class="contents">
              <div class="header">
                <h2>Recent</h2>
              </div>
              <ol>
                <li>Something Something</li>
                <li>...</li>
              </ol>
            </div>
          </div>
      </div>
    

    and CSS:

    body {
          background:#444;
        }
         #modal {
           background:#FFF;
           position: absolute;
           top: 4em;
           bottom: 4em;
           left: 6em;
           right: 6em;
         }
    
         #modal .left,
         #modal .right {
           position:absolute;
           top: 0;
           bottom: 0;
         }
    
         #modal .left {
           background:#ACF9E4;
           left: 0;
           right:50%;
         }
    
         #modal .right {
           background:#FCFFCD;
           right: 0;
           left:50%;
         }
    
         #modal .contents {
          position:absolute;
          top: 0;
          bottom: 0;
          width: 100%;
          overflow-y:auto;
         }
    
         #modal .description {
           height: 8em;
         }
    
         #modal .description + .contents {
           top: 10em;
       }
    
         #modal .header,
         #modal .description,
         .contents li {
           border-bottom:1px solid #CCC;
           padding: 1em;
         }
    
         #modal .description dt {
           float: left;
           padding-right: 1em;
         }
    

    It’s a really useful and robust technique. A lot of people get the shudders when you mention ‘absolute positions’, but used like this, it’s really liberating!

    The JS (assuming jQuery)

    $(function(){
        $('#modal').on('display', function(){
            //Calculate the height of the top left panel, and provide the remaining space to the bottom left
            var leftColumn = $(this).find('.left'),
                descriptionHeight = leftColumn.find('.description').height('auto').outerHeight(); //Set the height to auto, then read it
    
            leftColumn.find('.contents').css('top', descriptionHeight)//Apply the height to the scrolling contents pane     
        });
    
        $('#modal').trigger('display');
    });​
    

    The JS resets the top-left pane to auto-height, then reads the height and applies it as the top co-ordinate of the bottom-left panel. It’s applied as a custom event, so you can trigger it as part of your modal display code.

    Here’s an answer I gave, using a similar technique, and more explanations of the hows and whys: The Impossible Layout?. Check the A list apart article for more discussion, and some simple fixes that make it work in IE6 (if you care about that).

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

Sidebar

Related Questions

(update) ICustomTypeDescriptor works for my Windows Forms app, but not for Silverlight; Not supported.
UPDATE: Solution at bottom. I recently switched from using a set up such as
UPDATE: An idea to make built-in strings non-iterable was proposed on python.org in 2006
[UPDATE] Was just an idiot mistake. See end for solution. I am trying to
UPDATE 11/18/2011 Check the accepted answer. It works and its a life saver! Hey
Update: Thanks to stardt whose script works! The pdf is a page of another
UPDATE mytable SET this = 'this' AND that = 'that' WHERE MATCH (items) AGAINST
Update : I solved the decoding problem, thanks to pimvdb Follows the solution (in
UPDATE: Turns out my code works. Browser was caching previous failed response. Thanks for
Update: I've done a full write-up of the way I found to do 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.