Search code examples
cssfootersticky-footer

Why is my Footer not sticking?


I'm in the process of re-doing my site - It's being built as and when I have time - I'm having a bit of a problem with two of the four pages with regards to the footer - I'm not too sure why it's not working as it seems to be working alright on two of the pages. I'm using the technique from here: (ryanfait.com/resources/footer-stick-to-bottom-of-page/)

I'm using these values in my CSS:

    /* BOTTOM BAR */

.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -122px;
}

.push, .footer {
    clear: both;
    width: 100%;
    height: 122px;
}

.footer {
    text-align: right;
    padding-right: 0px;
    padding-left: 0px;
    clear:both;
    background-color: #2e2e2e;
    -moz-box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
    -webkit-box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
    box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
    border-top:1px solid #36383D;
}

.bottom_content {
    width: 900px;
    margin-left:auto;
    margin-right:auto;
    padding-top: 25px;
    border: 0px;
}

.copywrite {
    float: left;
    text-align: left;
    padding:0px;
    margin-top: 0px;
    clear: both;
    font-family: Helvetica, Arial;
    font-size:24px;
    font-weight:300;
    color: #3c3e43; 
}

But not on here: http://bit.ly/NfVoRR Or the about page (/test/test_about.php)

I've tried a number of different things, but to no avail! Starting to tear my hair out a bit with it, so any advice would be massively appreciated

EDIT - Here is what I am seeing: jameshenry.info/test/BottomExamples.png I'm seeing this in chrome, safari and also safari iOS. I want it to always sit on the bottom of the page, underneath the page content.


Solution

  • The problem lies in your HTML.

    Here is an example of poorly nested tags in your source:

    <a class="fancybox-thumb" rel="gallery" href="../images/photography/fullsize/MVI_4003-2.jpg" width="249" height="148"><img src="../images/photography/thumbnail/MVI_4003-2-thumb.jpg"></div></a>
    

    As you can see there is a closing div tag in your anchor that shouldn't be there. Fix these kinds of errors and your footer should work as intended.