CSS | Scroll Snap type Last Updated : 23 Aug, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The Scroll Snap type property is an inbuilt property in the Scroll Snap module. Without the Scroll Snap module, the image gallery will look ridiculous. Before the Scroll Snap module, this effect can be achieved by JavaScript but during this days Scroll Snap with the CSS can be achieved. This property is useful to stop scrolling at some specific point of the page. You can use this property in the gallery section of your web-page. It will give you the full control of the scrolling. Syntax: scroll-snap-type: none | [ x | y | block | inline | both ] [ mandatory | proximity ] Property Values: This property uses many values as mentioned above and described below: none: This property disable the scroll snapping that will ignore the snapping points.x: This property enables the scroll snapping along with the x-axis that works on snap position of horizontal axis.y: This property enables the scroll snapping along with the y-axis that works on snap position of vertical axis.block: This property enables the scroll snapping along with the block-axis that works on snap position of block axis.inline: This property enables the scroll snapping along with the inline-axis that works on snap position of inline axis.both: This property enables the scroll snapping with the both-axis included x, y, block and inline axis.mandatory: This property enables specific strict value that go to the specific scroll position when there is no scrolling.proximity: This property enables specific strict value that go to the specific scroll position. If scrolling action gets pretty close to a snap position if not close then it will act normally and should not snap at all. Example: Below example will illustrate the Scroll Snap type property: html <!DOCTYPE html> <html> <head> <title> CSS Scroll Snap Type </title> <style> h1 { color: green; } .container { width: 500px; height: 200px; margin-left: auto; margin-right: auto; border: 2px solid black; overflow: scroll; position: relative; } .element { width: 480px; height: 180px; scroll-snap-align: start; scroll-snap-stop: normal; color: white; font-size: 50px; display: flex; justify-content: center; align-items: center; } .y-mandatory { scroll-snap-type: y mandatory; } .element:nth-child(1) { background: url("https://www.geeksforgeeks.org/wp-content/uploads/html-768x256.png"); } .element:nth-child(2) { background: url("https://www.geeksforgeeks.org/wp-content/uploads/CSS-768x256.png"); } .element:nth-child(3) { background: url("https://www.geeksforgeeks.org/wp-content/uploads/javascript-768x256.png"); } </style> </head> <body> <center> <h1>GeeksforGeeks</h1> <h4>CSS Scroll Snap Type</h4> <div class="container y-scroll y-mandatory"> <div class="wrapper"> <div class="element"></div> <div class="element"></div> <div class="element"></div> </div> </div> </center> </body> </html> Output: Supported Browsers: The browsers supported by Scroll Snap Type are listed below: Google Chrome 69 and aboveEdge 79 and aboveOpera 56 and aboveFirefox 68 and aboveSafari 11 and above Comment More infoAdvertise with us Next Article CSS scroll snap S skyridetim Follow Improve Article Tags : Web Technologies CSS CSS-Properties Similar Reads CSS | Scroll Snap stop The Scroll Snap stop property is an inbuilt property in the Scroll Snap module. The Scroll Snap stop property stops or you can lock the scroll at some specific position that you define. It works like there is a pattern in your every slide and when the user scrolls the slide the pattern automatically 2 min read CSS scroll snap The CSS Scroll Snap module is an inbuilt feature in CSS that allows developers to control the behavior of scrollable elements and their children with precision. It introduces a new method of scrolling where the viewport "snaps" to predefined points. This ensures that the content aligns perfectly in 3 min read CSS | ::-webkit-scrollbar ::-webkit-scrollbar is a pseudo-element in CSS employed to modify the look of a browser's scrollbar. Before we start with how it works and how can it be implemented, we need to know some facts about the element. Browsers like Chrome, Safari and Opera support this standard Browsers like firefox don't 3 min read CSS | Scroll Padding top The Scroll Padding top is an inbuilt property in Scroll Snap module. This property set the scroll padding top longhand. This property acts as a magnet on the top of the sliding element that stick to the top of the view-port and stop the scrolling(forcefully) in that place. The Scroll Padding propert 2 min read CSS scroll-snap-align property CSS scroll-snap-align property represents the snap position of a box's snap area within the element's or container's snap port.Syntax:scroll-snap-align: Keyword_Values;/* Or */scroll-snap-align: Global_Values;Property values: The scroll-snap-align property accepts two values mentioned above and desc 1 min read Foundation CSS Scrolling Table Foundation CSS is an open-source and responsive front-end framework created by ZURB in September 2011 that makes it simple to create stunning responsive websites, apps, and emails that operate on any device. Many companies, like Facebook, eBay, Mozilla, Adobe, and even Disney, use it. This framework 3 min read Like