Search code examples
htmlimagefooter

Having an image at the bottom of the page at all time in HTML


I'm working on a basic html webpage and I'm still learing it that's the reason for this stupid question.

So basically I have this image which is a bar that I want to have going at the bottom of the page and staying at that location even if you scroll on the page. So basically it will always be visable. You can call it a footer I guess but it should always be visable.

Hope you understand what I mean.

How do I do this? :)


Solution

  • Set in your CSS something like this:

    #footer {
        position: fixed;
        bottom: 0px;
        /* eventually */
        left: 0px;
        width: 100%;
        height: 20px;
        z-index: 101;
    }
    

    That should do the trick - apply it to a DIV element and put your image inside or set it as a background.