Footer at bottom of browser except when I scroll

前端 未结 2 1599
情书的邮戳
情书的邮戳 2021-01-19 06:36

I\'m having a weird footer issue.

http://jsfiddle.net/YGAvd/

The clouds at the bottom of the page will stick to the bottom of the browser window if I expand

相关标签:
2条回答
  • 2021-01-19 07:00

    In the footer CSS rule change 'position: absolute;' to 'position: fixed;'

    you may also have to play with a few other def's but this works.

    check it out

    Here is my final footer rule

    footer {
        position: fixed;
        color: black;
        width: 100%;
        height: 4.6em;
        background-image: url(http://img.photobucket.com/albums/v410/justice4all_quiet/bottom_clouds.jpg);
        background-repeat: repeat-x;
        background-color: e0e0e0;
        z-index: -999;
        overflow: hidden;
        bottom: 0px;
    }
    
    0 讨论(0)
  • 2021-01-19 07:09

    Don't put the background image in the footer.... make it the body background image!

    Then make your body tag look like this:

    body {
        line-height: 1;
        overflow: auto;
        background-image: url(http://img.photobucket.com/albums/v410/justice4all_quiet/bottom_clouds.jpg);
        background-repeat: repeat-x;
        background-position:bottom center;
        background-attachment:fixed;
        background-color: #b1ceff;
        font: normal 95% Sathu, Verdana, Arial, Tahoma;
        text-align: center;
        height: 100%;
    }
    

    Don't forget to remove the code from your footer for the image. ALSO, remove the background color in the footer to avoid any issues.

    0 讨论(0)
提交回复
热议问题