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

  • Home
  • SEARCH
  • 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 9006359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:23:27+00:00 2026-06-16T01:23:27+00:00

I have created two divs in a page one is header and other is

  • 0

I have created two divs in a page one is header and other is the content

   <div id="main"> 
    <div id="header">
    </div>
    <div id="content"> 
    </div>
   </div>

And the style is

<style>
#main{
height:100%;
}
#header{
height:100px
}

#content{
height:???? // to fit the content 100% on any kind of screen 
}
</style>

I want to adjust the content according to the screen. screen height can be 100px and it might be 2000px. How I can do it with css. I do not want white space at the bottom or to scroll the page

  • 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-16T01:23:28+00:00Added an answer on June 16, 2026 at 1:23 am

    If you are fine using CSS3, this code:

    html, body {
        height: 100%;
        margin: 0;
        padding: 0;
    }
    
    #main{
        height:100%;
        background-color: blue;
    }
    
    #header{
        height: 10%;
        background-color: green;
    }
    
    #content{
        height: -webkit-calc(100% - 105px);
        background-color: red;
    }
    

    Will do the trick in chrome. You will have to test the alternatives for the calc property for the other browsers. You will have to play with the margin and padding of the parent elements to get exactly your desired effect, but this is the idea.

    If CSS3 is not an option, then you are going to have to define your header in percent unless somebody smarter than me can give you a better alternative :).

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

Sidebar

Related Questions

I have created two JavaScript files. One file is "validators.js" and the other is
Suppose I have two DIVs on my page. <body> <div id=d1></div> <div id=d2></div> </body>
I have a page (created not by me) with two divs. This divs contains
If you have two divs contained within a div: <div style=border:1px;> <div style=float:left;background-color:red;width:20px;height:20px;> <div
I have created two DbContexts, one is for application configuration, the second is for
I have created two folders layout and layout-land with two xml files, one for
I have created two forms in my Windows Application. One Form acts as a
I have created two viewController classes such that one is superclass of another.i have
I've created a blog main page using PHP and have included a sidebar and
I have two divs, one on the left, and one on the right side

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.