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

The Archive Base Latest Questions

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

<div id=wr> <div id=con_top></div> <div id=con_bottom></div> </div>​ #wr { height:400px; width:80%; margin:50px auto; border:1px

  • 0
<div id="wr">
    <div id="con_top"></div>
    <div id="con_bottom"></div>
</div>​

#wr {
    height:400px;
    width:80%;
    margin:50px auto;
    border:1px solid black;
}
    #con_top {
        height:40px;
        margin:5px;
        border:1px solid red;            
    }
    #con_bottom {
        height:100%;
        border:1px solid blue;
        margin:5px;    
    }​

http://jsfiddle.net/nMbWw/

How to make blue square, fit the black, parent container? Is it possible without javascript?

With table elements it’s much easier, but table is bugged in Opera and IE. td element on height 100% doesn’t work as intended, taking the height of table element itself ignoring the height of all others td in that table.

For example, open with Opera or IE:

http://jsfiddle.net/UTMRn/3/

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

    Forget tables :). You could use absolute positioning:

    #wr {
        height:400px;
        width:80%;
        margin:50px auto;
        border:1px solid black;
        position: relative; /* added to keep the absolute element inside */
    }
    
    #con_top {
        height:40px;
        margin:5px;
        border:1px solid red;            
    }
    
    #con_bottom {
        border:1px solid blue;
        margin:5px;    
        position: absolute; /* make it absolute */
        top: 45px; /* the height of the other element + its margin */
        bottom: 0; /* stick to the bottom */
        left: 0; /* stick to the left */
        right: 0; /* stick to the right */
    }​
    

    jsFiddle Demo

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

Sidebar

Related Questions

I have a div,which content some text content. <div id=con style=position:absolute;left:50px;top:50px;border:1px solid red;font-size:12px;> Text
Div 'canvasesdiv' element contains three HTML5 canvases. <div style=position: relative; width: 400px; height: 300px;
div#thing { position: absolute; top: 0px; z-index: 2; margin: 0 auto; } <div id=thing>
I have a div with a width of 200px. There is text inside that
I have this form: <div class=row border-tb> <form id=test-form action=/test/insert method=post class=form-inline offset4 span16>
I want to add auto stretch the content div and add horizontal scroll to
<div id=wr> <div id=con> <div id=unknownWidth>some box with unknown width</div> </div> <div id=knownWidth></div> </div>
div img:hover { outline:2px solid #4d3326; } The above code is not working in
Div height is not support in below code <html> <head> <meta http-equiv=Content-Type content=text/html; charset=windows-1252>
this div to cover up the viewport works perfect on IE 7, 8, FF,

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.