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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:30:52+00:00 2026-05-24T01:30:52+00:00

i have a mind bobbling question. I need a 100% width, 100% height container

  • 0

i have a mind bobbling question.

I need a 100% width, 100% height container with 20px margin that expands with content. Is this at all possible? The closest i got was with this method:

#container {
    position:absolute;
    top:0;
    bottom:0px;
    left:0;
    right:0;
    margin:20px;
}

but then it wont expand in height with content.

Anybody know the divine technique for this?

  • 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-24T01:30:54+00:00Added an answer on May 24, 2026 at 1:30 am

    I’m pretty sure it isn’t possible to do with a single element, but if you don’t mind having 3 spacer div elements, this solution works in all browsers:

    <html>
    <head>
    <style type="text/css">
    * {
        margin: 0;
    }
    html, body {
        height: 100%; padding: 0; /* padding 0 is for jsfiddle */
    }
    #wrapper {
        min-height: 100%;
        height: auto !important;
        height: 100%;
        margin-left: 20px;
        margin-right: 20px;
        margin-bottom: -20px; /* the bottom margin is the negative value of the spacer height */
        background-color: #ccc;
    }
    .spacer.edge {
        background-color: white; /* same as body background */ 
    }
    .spacer {
        height: 20px;
     }
    
    </style>
    </head>
    <body>
        <div id="wrapper">
            <div class="spacer edge"></div>
            <!-- content here -->
            <div class="spacer"></div>
        </div>
        <div class="spacer edge"></div>
    </body>
    </html>
    

    Here’s a fiddle to play with: http://jsfiddle.net/dTyTW/

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

Sidebar

Related Questions

I have the following code: Bear in mind that while this code works on
I found this: http://msdn.microsoft.com/en-us/library/vslangproj80.reference3%28VS.80%29.aspx what I have in mind is that many of the
Well this time the question I have in mind is what should be the
This is my first tryst with C#. The form that i have in mind
Here is what I have in mind: 1) Create a service that will run
The kind of simulation game that I have in mind is the kind where
I'm new to Django, but the application that I have in mind might end
I'm new to c++ but have set my mind on a specific task that
I have a project in mind that will require the majority of queries to
I have a specific case in mind, but the question applies in general too.

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.