Search code examples
jquerycsscss-positionfootersticky-footer

Creating a page footer div?


I need to create a page footer, basically a div that stretch 100% width of the page. With a height of 300px. I need it to stick to the absolute bottom of the page. Could somebody please show me how to do this using CSS?

I have not included code as the code would simply be div tags.

Thanks


Solution

  • If you set the footer to position: fixed, it will appear above your content, even if the page is longer than the window.

    If what you want is only to keep the footer at the bottom, even when the content is really short, there's that answer : Sticky footer on Stack overflow

    That way, your footer will stay at the bottom of the page OR at the end of the content.