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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:13:48+00:00 2026-05-23T17:13:48+00:00

<div id=content> <div id=header> </div> <div id=main-content> </div> </div> html, body{height:100%;margin: 0px; padding: 0px;

  • 0
<div id="content">
        <div id="header">

        </div>

        <div id="main-content">


        </div>


    </div>


html, body{height:100%;margin: 0px; padding: 0px; background-color: black;}


div#content{width:600px; margin: 0 auto; height:100%;}

div#header{width:600px; height:200px;}

div#main-content{width:600px; height:100%; background-color: white;}

As you can see, adding a header pushes everything down. I want main-content to extend to the end of the browser.

I think i worked around this issue before by creating a header with an image similar to my background in order to fake the appearance, however my background i’ll be using is much too complicated.

Are there any methods to do this? possibly a working javascript fix?

  • 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-23T17:13:48+00:00Added an answer on May 23, 2026 at 5:13 pm

    You can make your main-content div positioned absolutely and then specify its top and bottom attributes. I’ve setup a jsfiddle here: http://jsfiddle.net/wrn8Y/1/

    div#main-content{
        position: absolute;
        top: 200px;
        width:600px;
        bottom: 0px;
        background-color: white;
    
    }
    

    Note that the top attribute is set to the bottom of your header, and the bottom is set to zero to hit the bottom of the page. If you wanted to have a footer you could change the bottom attribute to accommodate the footer.

    Also you can do this with javascript, I generally use JQuery so here is some JQuery code that gets it done:

    $('div#main-content').height($(document).height() - $('div#header').height());
    

    This javascript (Jquery) will work with relatively positioned divs and the only css you would need to change is to remove the “height: 100%” on the “div#main-content” style.

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

Sidebar

Related Questions

My Html markup <div id=main-wrapper> <div id=header-wrapper> <div id=header> </div><!--end of #header --> <div
my site has three div elements, header, content and footer. i have a picture
I have multiple menues on my page... <div class=menu> <div>Menu header</div> <div>Menu content</div>// should
I am looking for a CSS-based web page template where the main content div
We have a div of content (#content) and on the right hand side of
In IE6 the left of the #right-content DIV is cut off. I've been playing
The page has a container div which holds multiple content divs. Each content div
$('#content td#foo').show(); $('td#foo').show(); The td is somewhere deep in the content div. What is
I have a page where there is a column and a content div, somewhat
I want to select an anchor inside a div like this <div class=response content>

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.