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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:57:38+00:00 2026-05-25T10:57:38+00:00

I am having a bit of a nightmare with the CSS on a page

  • 0

I am having a bit of a nightmare with the CSS on a page that I am working on. I have two div tags a header and a main content the header is set to a height of 250px and the main is then set to a height of 100%. I have also set the height on the html and body to 100% as well in order to satisfy the issue with a container set to 100% in the page.

The issue is that I now have a page that exceeds the size of the browser and show a scroll and I do not want to remove the scroll bar because the page may exceed the size of the browser.

HTML CODE:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Page Height 100% Issue</title>

<link href='../style/test.css' rel='stylesheet' type='text/css' />

</head>

<body>

<div class='head'>Header</div>

<div class='content'>Main Content</div>

</body>
</html>

CSS:


html {
    height:100%;0
}

body {
    height:100%;
}

div.head {
    width:100%;
    height:250px;
}

div.content {
    width:100%;
    height:100%;
}

Can anyone help me to get this all on one page set to the maximum size of the page without scroll bars, height 100%.

  • 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-25T10:57:38+00:00Added an answer on May 25, 2026 at 10:57 am

    You’re setting a height of 100% on div.content, which will take up 100% of it’s container element (body). So the height of body overall will be 100% + 250px (the height of div.head), which is not what you want.

    Adding a containing div and setting the height on that would be the best way to go, I’ve tested this code and it seems to work:

        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <title>Test Page Height 100% Issue</title>
    
        <style type="text/css">
        html {
            height:100%;
        }
    
        body {
            height:100%;
         margin:0;
        }
    
        div.head {
            width:100%;
            height:250px;
        }
    
        div.container{
    
            height:100%;
        }
    
        div.content {
            width:100%;
        }
        </style>
    
        </head>
    
        <body>
            <div class="container">
                <div class='head'>Header</div>
    
                <div class='content'>Main Content</div>
            </div>
        </body>
    
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a bit of a problem with the AJAX Accordion Control... I have two
Having a bit of a problem, Due to the source-control set-up we use, each
Having a bit of trouble using the List.Find with a custom predicate i have
I'm having a bit of trouble with a a function that the mongodb c
I am having a bit of a strange issue. I have a ListView which
I'm having a bit of a nightmare trying to get REE playing nicely with
Afternoon peoples. I am having a bit of a nightmare traversing a DOM tree
having a bit of trouble adding some data to a database. I have the
I'm having bit complicated object model that forms a triangle. There is User entity
Having a bit of trouble getting jQuery and Prototype working together. The error console

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.