Open In App

CSS scroll-padding-left Property

The scroll-padding-left property is used to set all the padding to the left of an scroll container or element at once. The value specified for the scroll-padding-left determines how much of the page that is primarily outside the snapsort should remain visible.

Syntax:



scroll-padding-left:length_values

Or

scroll-padding-left:keyword_values

Or



scroll-padding-left:Global_Values

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

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




<!DOCTYPE html>
<html>
 
<head>
    <style>
        .geek {
            width: 275px;
            height: 300px;
            border: 2px solid red;
            scroll-snap-align: none start;
        }
 
        .GeeksforGeeks {
            width: 300px;
            height: 300px;
            border: 2px solid green;
            text-align: center;
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            scroll-snap-type: x mandatory;
        }
    </style>
</head>
 
<body>
    <div class="GeeksforGeeks" style=
            "scroll-padding-left: 80px;">
        <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 :