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
Rishit
CodePen
VwGRNjG
...
11 Replies
~MARSMAN~
~MARSMAN~2y ago
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 course
rishit
rishit2y ago
tysm but i dont get why the overflow is required cuz its alr overflowing
~MARSMAN~
~MARSMAN~2y ago
A defined container size and setting the overflow are A must to have for the scroll snap to work.
~MARSMAN~
~MARSMAN~2y ago
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.
~MARSMAN~
~MARSMAN~2y ago
See here for more info
rishit
rishit2y ago
k ty but weird issue when i turned on the nav 2 scroll bars
~MARSMAN~
~MARSMAN~2y ago
Can you add it into your CodePen?
rishit
rishit2y ago
fixed i put body as the container instead of main n it fixed it
~MARSMAN~
~MARSMAN~2y ago
Ok great 👍
Adeeva
Adeeva15mo ago
i can do scroll snap but it cant work with animation
Want results from more Discord servers?
Add your server