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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:51:53+00:00 2026-05-21T14:51:53+00:00

I’ve found 2 different implementations of a CSS sticky footer: Ryan Fait sticky footer

  • 0

I’ve found 2 different implementations of a CSS sticky footer:

  1. Ryan Fait sticky footer – http://ryanfait.com/sticky-footer/

  2. Steve Hatcher sticky footer – http://www.cssstickyfooter.com/

Could someone explain the difference between how each of them work?

And if there are other known implementations, could you please post a comment or edit this question?

  • 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-21T14:51:54+00:00Added an answer on May 21, 2026 at 2:51 pm

    They are pretty similar in terms of function. The first forces a div to the full height of the page and then give it a negative margin the size of the footer.

        html, body {
        height: 100%; /*set 100% height*/
    }
    .wrapper {
        min-height: 100%;  /*content 100% height of page */
        height: auto !important;
        height: 100%; 
        margin: 0 auto -142px; /* negative value causes wrappers height to become (height of page) minus 142px, just enough room for our footer */ 
    }
    .footer, .push {
        height: 142px; /*Footer is the footer, push pushes the page content out of the footers way*/
    }
    

    What this does is makes sure that all content within the wrapping div is 100% of the page height minus the height of the footer. So that as long as the footer is the same size as the negative margin it will stick in the gap left and appear at the bottom of the element.

    The second also forces the content to be 100% of the height of the page.

    html, body {height: 100%;}  /*set 100% height*/
    
    #wrap {min-height: 100%;} /* make content 100% height of screen */
    

    It then creates a space at the bottom of the main content the same size as the footer.

    #main {overflow:auto; 
    padding-bottom: 150px;} /* wrapper still 100% height of screen but its content is forced to end 150px before it finishes (150px above bottom of screen) */
    

    Then using position relative and a negative top margin forces the footer to appear 150px above its normal position (in the space it just made).

    #footer {position: relative;
    margin-top: -150px; /* Make footer appear 150px above its normal position (in the space made by the padding in #main */
    height: 150px;
    clear:both;} 
    

    Note: This only works so long as your page content is kept within .wrapper and #main inside #wrap respectively, and your footer is outside of these containers.

    If you didn’t understand any part of that leave me a comment and I’ll try to answer it.

    Edit: In response to user360122

    HTML markup for first:

    <html>
    <body>
    <div class="wrapper">
    <!--Page content goes here-->
    <div class="push">
    <!--Leave this empty, it ensures no overflow from your content into your footer-->
    </div>
    </div>
    <div class="footer">
    <!--Footer content goes here-->
    </div>
    <body>
    </html>
    

    HTML markup for second:

    <html>
    <body>
    <div id="wrap">
    <div id="main">
    <!--Page content goes here-->
    </div>
    </div>   
    <div id="footer">
    <!--Footer content goes here-->
    </div>
    </body>
    </html>
    

    Remember to include the stylesheet and declare doctype .etc (these aren’t full html pages).

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

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I've tracked down a weird MySQL problem to the two different ways I was
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.