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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:57:44+00:00 2026-05-24T16:57:44+00:00

Lord, I’m not even sure how to phrase the title for this one. I’ve

  • 0

Lord, I’m not even sure how to phrase the title for this one.

I’ve included an image of what I’m trying to accomplish below.
http://www.wideeyedcommunications.com/images/positioning-sample.png

I have a footer set to the bottom of the screen. A containing div is overlapping that footer. I need that containing div’s height to be a set distance from the bottom of the screen irrespective of the resolution of the screen or the quantity of the content in the containing div.

So, the green footer (squiggle) is always locked to the bottom of the screen, and the bottom of the brown div is within, let’s say 20 pixels of the bottom of the screen no matter how much or little content is within that div.

So if I have 1 line of text and no scrollbars, then it’s height is viewport - 20px. And if I have 1000 lines of text and scrollbars the height is still viewport - 20 px.

I’d guess that jquery could do it with something like:

$(".container").height(function(){
  $(window).height-20;
});

But is it possible to accomplish this without using javascript?

Edit: Here’s some of the code.

<body>
  <div style="position: relative; padding-bottom: 20px;">
    <div id="grass">&nbsp;</div>
      <div id="container">
        <div id="content">
        Navbar, content, etc goes here
        </div>
      </div>
  </div>
</body>

And the existing css

#grass {
  background: url("../images/bg_grass.jpg") repeat-x scroll center bottom;
  bottom: 0;
  height: 420px;
  position: absolute;
  width: 100%;
  z-index: -10;
}
#container {
  margin: 35px auto 0;
  position: relative;
  width: 960px;
}
#content {
  background: none repeat scroll 0 0 #FFF8ED;
  border: 2px solid #764C29;
  border-radius: 13px 13px 13px 13px;
  margin-bottom: 20px;
  overflow: hidden;
}

I’ve just uploaded a demo site to http://jsfiddle.net/Fireflight/HQvay/

  • 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-24T16:57:45+00:00Added an answer on May 24, 2026 at 4:57 pm

    You’ll have to add a margin-bottom to your container, and then set it’s height with jQuery:

    CSS:

    .container { margin: 20px auto }
    

    Javascript:

    $(window).resize(function(){
          $('.container').css('height', $(window).height() - 40);
    }).resize();
    

    Note: If your container has padding and/or borders, you’ll have to include those in your calculations.

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

Sidebar

Related Questions

I am trying to enable mod_write's rewrite URL and am not able to get
My program should be able to work this way. Below is the content of
I would like to know which part is not correct? I fixed one but
In this situation I am trying to perform a data import from an XML
Assume I have the following XML file: <Movies> <Movie ownerName=Ryan> <Title>The Lord of the
I have XML in the form: <Books> <Book> <Name>Lord of the Rings</Name> </Book> <Book>
Eg :a=[[hello, world], [good, lord], [hello, lord]] I need to find and record the
Supposedly I have this line in my text file which has the following format.
I need an exactly opposite method of timezone_name_from_abbr(): http://php.net/manual/en/function.timezone-name-from-abbr.php I have a list of
Supposingly I am working on one of my options in my program. I have

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.