CSS scroll-margin-right property Last Updated : 25 Jul, 2024 Comments Improve Suggest changes Like Article Like Report The scroll-margin-right property is used to set all the scroll margins to the right of an element at once. The value specified for the scroll-margin-right determines how much of the page that is primarily outside the support should remain visible.Hence, the scroll-margin-right values represent outsets that define the scroll snap area that is used for snapping this box to the support.Syntax:scroll-margin-right: length/* Or */scroll-margin-right: Global_ValueProperty values: This property accepts two-properties mentioned above and described below:length: This property refers to the values defined with length units exp: px, em, vh, etc.Global_Values: This property refers to the global values like inherit, initial, unset, etc.Note: scroll-margin-right doesn’t accept percentage value as the length. Example: In this example, you can see the effect of scroll-margin-right by scrolling to a point partway between two of the “interfaces” of the example’s content. HTML <!DOCTYPE html> <html> <head> <style> img { width:300px; height:280px; scroll-snap-align: none end; } .Gallery { width: 300px; height:300px; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scroll-snap-type: x mandatory; } </style> </head> <body> <div class="photoGallery"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20200723131450/img6-300x82.png" style="scroll-margin-right: 50px;"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20200723131449/img5.jpeg" style="scroll-margin-right: 60px;"> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20200723131452/img4-300x167.png" style="scroll-margin-right: -50px;"> </div> </body> </html> Output: Browsers supported:Google Chrome 69Edge 79Firefox 68Opera 56Safari 14.1 Comment More infoAdvertise with us Next Article CSS scroll-margin-right property T thacker_shahid Follow Improve Article Tags : Web Technologies CSS CSS-Properties Similar Reads CSS scroll-margin Property The scroll-margin property is used to set all the scroll margins of an element at once. The value specified for the scroll-margin determines how much of the page that is primarily outside the support should remain visible. Hence, the scroll-margin values represent outsets that define the scroll snap 2 min read CSS scroll-padding-right Property The scroll-padding-right property is used to set all the padding to the right of an scroll container or element at once. The value specified for the scroll-padding-right determines how much of the page that is primarily outside the snap scroll should remain visible.Syntaxscroll-padding-right: keywor 1 min read CSS margin-right Property The margin-right property in CSS is used to set the right margin of an element. It sets the margin area on the right side of the element. Negative values are also allowed. The default value of the margin-right property is zero. Syntax:margin-right: length|auto|initial|inherit;Property Value:length: 3 min read CSS scroll-margin-left property The scroll-margin-left property is used to set all the scroll margins to the left of an element at once. The value specified for the scroll-margin-left determines how much of the page that is primarily outside the support should remain visible.Hence, the scroll-margin-left values represent outsets t 2 min read CSS scroll-margin-block property The scroll-margin-block property is used to set all the scroll margins to the start and end of a scroll element at once. This property is shorthand for the scroll-margin-block-start and scroll-margin-block-end property.The selection of the start and end sides depends upon the writing mode. The start 2 min read Like