What is the best way to remove scrolling when you have a fixed navbar at smaller screens?
When I open the navbar I don't want the user to be able to scroll the content underneath it. How can I do this?
2 Replies
You'll want to declare
overflow: hidden on the html element. There are a few ways you might do that, but it all depends what you're doing to open/close the navYou might be looking for overscroll-behavior. Checkout out MDN example of the "contain" value. https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior
MDN Web Docs
overscroll-behavior - CSS | MDN
The overscroll-behavior CSS property sets what a browser does when reaching the boundary of a scrolling area.