Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Help making a sticky footer

Posted by: wrybread May 28 2020, 12:17 PM

I'm trying to make a webpage that simulates a mobile app, with a footer that remains in place at the bottom of the view even as the content goes beyond it. I'm having a surprising amount of trouble doing so.

Here's a stripped down version of my code:

https://codepen.io/wrybread/pen/OJyexmL

(In that example, if you scroll down you'll see my footer. If you change the height of the div with the inline style to something shorter than the view the footer will pin to the bottom).

This works until the content is larger than the screen, and then it pushes the footer down off the screen.

I don't imagine anyone has any tips?

Using a plugin would work for me too.

Thanks for any help.

Posted by: Christian J May 28 2020, 02:30 PM

You mean you want the footer fixed at the bottom of the browser's viewport, even when the user scrolls? That can be done with CSS "position: fixed": https://davidwalsh.name/demo/css-fixed-position.php

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)