DEV Community

Discussion on: Making a footer stick to the bottom with CSS

Collapse
 
ertankara profile image
Ertan Kara • Edited

This was a thing that I dealt with a few weeks back on my own blog. I fixed it with JS but I was ashamed of the solution. Thanks for this, I will apply this one instead of following.

(() => {
  if (window.innerHeight >= document.body.scrollHeight) {
    document.querySelector('footer').classList.add('fixed-footer')
  }
})();
Enter fullscreen mode Exit fullscreen mode
Collapse
 
dailydevtips1 profile image
Chris Bongers

Hi Ertan, It's cool you found your own solutions as well, it's what we do as developers.
There are always different quicker solutions.