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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:46:18+00:00 2026-06-17T23:46:18+00:00

I have seen it before and have done it so I know it works

  • 0

I have seen it before and have done it so I know it works pretty consistently, however, I want to know if that is valid and if there are caveats that I have not thought of.

example: http://jsfiddle.net/sfctB/67/ I offered this fix for someone with a FF overflow problem recently, which was caused by a box-sizing property. Adding the simple -moz- prefix fixed it as well but I opted for something that seemed more valid to me. I set the top and bottom on a content div so that it always stretches between a fixed header and fixed footer. Then set margins to avoid the overflow.

I would intuitively think that using top and bottom or right and left at the same time would cause problems, however, what it seems to do is make right act kind of like width when there is a left already stated and make bottom act kind of like height when there is already a top stated.

But is this valid and should I use it when considering long term support?

code

html, body {
    height:100%;
    width:100%;
    overflow:hidden;
}
body {
    padding: 60px 0px;
    height: 100%;
}
.header {
    height:60px;
    background:#000;
    color:#fff;
    width: 100%;
    position: fixed;
    top:0;
}
.body {
    overflow-y: scroll;
    position:fixed;
    bottom:0;
    top:60px;
    margin: 0 0 60px 0;
}
.footer {
    height:60px;
    background:#000;
    position:fixed;
    bottom:0px;
    width:100%;
    color:#fff;
}



<!DOCTYPE html>
<html>

    <head></head>

    <body>
        <div class="header">This is header</div>
        <div class="body">[content here]</div>
        <div
        class="footer">This is footer</div>
    </body>

</html>
  • 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-17T23:46:19+00:00Added an answer on June 17, 2026 at 11:46 pm

    Good question. I’ve wondered about this for a long time, so I went to the spec ( http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width and http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height). It looks like it’s a fully spelled out and the answer is what you’d expect it to be. For an absolutely positioned element if width is “auto” and left and right are defined then:

    5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve for 'width'
    

    Similarly for height:

    5. 'height' is 'auto', 'top' and 'bottom' are not 'auto', then 'auto' values for 'margin-top' and 'margin-bottom' are set to 0 and solve for 'height'
    

    I think tPlummer makes a good point, however. The spec and reality may be two different things; especially when it comes to older browsers.

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

Sidebar

Related Questions

I am not an expert in Git, but I have seen this done before
Now I have something that I have not seen it before: the database is
Okay i've seen this done somewhere before where you have a function that takes
I have searched through many times but have not seen this before. Probably really
So I have seen this done before and I completely forgot where or what
Please see the back trace below, I don´t think I have seen this before
I have never seen this before, the rows will be sequential but I have
I have seen some people in SO commenting that Singleton Pattern is an anti-pattern.
I have seen behaviour in Perforce that I am unable to explain. I took
I have a PangoFontDescription and I want to know whether it describes a monospace

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.