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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:25:08+00:00 2026-05-23T12:25:08+00:00

Sample page On the sample page I have set div#content { padding-bottom:20px; } which

  • 0

Sample page

On the sample page I have set div#content {
padding-bottom:20px;
}
which works well if 20px is enough to leave the footer beneath the content div. However, if the footer changes size, I’ll need to change the amount of padding-bottom aswell. I want a more flexible solution.

Is it possible to fix this without moving the footer outside of the content-div?

Update:
found this page that describes a solution to the problem, but the author also states that:

There is only one limitation
You must set the height of the footer div to something other than auto. Choose any height you like, but make sure the value is specified in pixels or ems within your CSS. This is not a big limitation, but it is essential for this method to work correctly.
If you have a lot of text in your footer then it’s also a good idea to give the text a bit more room at the bottom by making your footer a bit deeper. This is to cater for people who have their browser set to a larger text size by default. Another way to solve the same problem is to set the height of the footer in em units; this will ensure that the footer grows in size along with the text. If you only have images in your footer than there’s nothing to worry about – just set your footer height to a pixel value and away you go.

Which leads me to believe that maybe what I want to achieve is not possible without JavaScript.

  • 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-23T12:25:09+00:00Added an answer on May 23, 2026 at 12:25 pm

    Because the height of the footer is unknown beforehand, you can’t set an explicit height (in px or em) in the CSS. You can, however, get the footer height with javascript and set your content padding-bottom to it. One line in jQuery:

    $('#content').css('padding-bottom', $('#footer').outerHeight(true) + 'px');
    

    The jsfiddle: http://jsfiddle.net/blineberry/cFSX4/19/

    You’ll probably want to set the padding-bottom in your CSS to your best guess of the footer height and let the javascript make the minor adjustments as necessary.

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

Sidebar

Related Questions

I have a simple html page with a div. I am using jQuery to
I have a simple page with my ScriptManager and my UpdatePanel , and my
K... I'm doing something obviously wrong. I have a simple page with a file
I have a simple web page that till now didn't need any login. It
I have a simple cart page that displays items that are in someones cart,
I have this simple Jsp page: <%@ page language=java import=java.awt.Color%> <% Color background =
I have a simple accordion type page containing a list of H3 headers and
I have a very simple ASP.Net page that acts as a front end for
I have a simple form on a view page, implemented as a user control,
I have a CSS layout that simulates a fixed-frame page, with a header 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.