Open In App

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.

Syntax:



scroll-padding-right: keyword_values

Or

scroll-padding-right: length_values

Or



scroll-padding-right: Global_Values

Property values: This property accepts three properties mentioned above and described below.

Example: Below example illustrates the scroll-padding-right property.




<!DOCTYPE html>
<html>
 
<head>
    <style>
        .geek {
            width: 300px;
            height: 275px;
            border: 2px solid black;
            scroll-snap-align: none end;
        }
 
        .GeeksforGeeks {
            width: 300px;
            height: 300px;
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            scroll-snap-type: x mandatory;
        }
    </style>
</head>
 
<body>
    <div class="GeeksforGeeks" style=
        "scroll-padding-right: 90px;">
 
        <img src=
            class="geek">
        <img src=
            class="geek">
        <img src=
            class="geek">
        <img src=
            class="geek">
        <img src=
            class="geek">
    </div>
</body>
 
</html>

Output:

Supported Browsers:


Article Tags :