Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s not a hard problem to notice or fix, probably just comes from people not using their site a lot. All you need to do is insert your content in a fib before a final “filler” div that has the same height as the floating footer. If your floating footer doesn’t have a fixed height (and there is some really good reason for that) a further hack is to measure it and then set the height of the filler div in js.


or just display the scrollable content in a container with overflow: scroll

you can then make the container fill the height/width with flexbox


Also works well, but that might introduce janky behavior with iOS safari’s title bar and tapping the top to scroll to top in my experience. I don’t know if this has been fixed, it’s been a while since I wore a CSS hat, but I vaguely remember fighting with mobile safari and overflow divs a lot.


ah, yes

in that case you can just add position: sticky and bottom: 0 to the footer

with this trick you get the same behavior as with position: fixed but won’t need a wrapper div as in the comment i replied to


Yeah position sticky is definitely part of what you want, telling the browser declaratively what you are trying to accomplish.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: