CSS | Scroll Padding Last Updated : 12 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The Scroll Padding property is an inbuilt property in Scroll Snap module. This property sets the scroll padding longhands. This property acts as a magnet on the top of the sliding element that sticks to the top of the viewport and stops the scrolling(forcefully) in that place. The Scroll Padding property is optional, this property is used when the Scroll Snap type property is set to none. Syntax: scroll-padding: [ length percentage | auto ] Property Values: This property accept two property mentioned above and described below: length-percentage: This property works same as other padding property contains the length in any specific unit for padding.auto: This property leaves some spaces for padding determined by browsers. Example: Below example illustrates the Scroll Padding property: html <!DOCTYPE html> <html> <head> <title> CSS Scroll Padding </title> <style> h1 { color: green; } .element{ border:2px solid black; } .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; /* scroll-padding: top right bottom left */ scroll-padding: 50px 0px 0px 20px; } .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 Padding</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 CSS Scroll Padding are listed below: Google Chrome 69 and aboveEdge 79 and aboveFirefox 68 and aboveOpera 56 and aboveSafari 14.1 and above Comment More infoAdvertise with us Next Article CSS | Scroll Padding bottom S skyridetim Follow Improve Article Tags : Web Technologies CSS CSS-Properties Similar Reads 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 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 Padding bottom The Scroll Padding bottom is an inbuilt property in Scroll Snap module. This property set the scroll padding 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 property 2 min read CSS | Scroll Padding bottom The Scroll Padding bottom is an inbuilt property in Scroll Snap module. This property set the scroll padding 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 property 2 min read CSS Padding Padding is the space between the content and the defined border of an element. Padding means adding spaces inside the element, controlling its internal space, thus affecting its dimensions and appearance. Table of Content CSS PaddingShorthand Property for Padding in CSS All CSS Padding PropertiesCSS 6 min read W3.CSS Padding W3.CSS has many facilities of classes to easily style elements in HTML. It includes various responsive padding classes for modification of the appearance of the element. There are two types of padding classes: Numbered Padding ClassesSized Padding Classes Numbered Padding Classes: These classes add 3 min read Like