Scroll snap not working
Hey, I wanna get each section to snap on scroll but its not working.
https://codepen.io/RS_2009/pen/VwGRNjG?editors=1100
11 Replies
Scroll snap only works for overflowing content.
You might wanna set the
main
height to 100vh ,in your case, and set the overflow to scroll.
Along with other scroll-snap properties of coursetysm
but i dont get why the overflow is required
cuz its alr overflowing
A defined container size and setting the
overflow
are A must to have for the scroll snap to work.CSS Scroll Snap - CSS: Cascading Style Sheets | MDN
CSS Scroll Snap is a module of CSS that contains features to control panning and scrolling behavior with snap positions.
See here for more info
k ty
but weird issue
when i turned on the nav
2 scroll bars
Can you add it into your CodePen?
fixed
i put body as the container instead of main n it fixed it
Ok great 👍
i can do scroll snap but it cant work with animation