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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:02:27+00:00 2026-05-14T04:02:27+00:00

I am working on a layout for a new site, and I’m having some

  • 0

I am working on a layout for a new site, and I’m having some trouble achieving what I want with the CSS. First of all, I want everything to always stay within the view of the current browser window, with scroll being in my content and not the browser itself. I have an outermost DIV which acts as my “wrapper” for the site displayed centered, with a set width, and having 100% height of the bowser window. Inside of this I place a header and all of this works as intended in all interested browsers.

However, once I place my actual content DIV inside this “wrapper” I am unable to define it to be the size I want. If I simply give it margins or padding to make up for the header I have absolutely positioned, the content will overflow and I can’t set scroll. And if I try to set the size directly, there are no values I can put in that will work since the margins/padding will add to the size and it will now be bigger than the current browser window, and overflow.

Are there any styles people can think of I can use on the wrapper/content DIV(s) to get the desired look? Here is a diagram illustrating the look I want.

  • 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-14T04:02:28+00:00Added an answer on May 14, 2026 at 4:02 am

    The following assumes, that you have a fixed height for your header (not a percentage). This example uses px values to make it easier to inspect with Firebug, but it works the same with em.

    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>Title</title>
    
        <style type="text/css">
    
            html, body {
                margin:0;
                height: 100%;
            }
    
            #wrapper {
                position:relative;
                width: 400px;
                height: 100%;
                margin: 0 auto 0 auto;
            }
            #header {
                position:absolute;
                margin-top:0;
                height: 70px;
                width: 400px;
                background-color: #ccc;
            }
            #content {
                position: absolute;
                top: 70px;
                bottom: 0;
                width: 400px;
                overflow: auto;
                background-color: #99c;
            }
        </style>
    
    </head>
    <body>
        <div id="wrapper">
            <div id="header">Header</div>
            <div id="content">
                Content<br/>
                Content<br/>
                Content<br/>
                Content<br/>
                Content<br/>
                Content
            </div>
        </div>
    </body>
    </html>
    

    The important point is, that #content doesn’t use a height at all – it uses a combination of top and bottom instead.

    Note: I’m pretty sure, that modifications will be required for IE 6 …

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

Sidebar

Related Questions

I'm working on a new layout for my site that uses a header, footer
I am working on new layout of my site & I come across GIZMODO
I am working on a site (new to HTML/CSS). I have a main container
I'm working on migrating a fairly large site to a new framework, but we're
I have a layout that is working, but it has one very annoying problem..
I'm working on a website with a em-based layout (so it can stretch and
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working with python interactively, it's sometimes necessary to display a result which is some
update: at bottom I am trying to get a layout working where the body
I am a brand new Java developer (I have been working in asp.net) and

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.