CSS scroll-padding-inline Property
Description
The scroll-padding-inline property defines an inset on the inline axis of a scroll container that establishes a “safe” area between the container edges and the content when snapping or programmatic scrolling occurs. Rather than altering the box model or visual padding of children, it shifts the reference frame used by scrolling algorithms so that targets align away from the physical edge by the specified inset. This makes it easier to ensure focused or snapped items are not flush against the viewport edge and remain visually comfortable and accessible.
Because it is a logical property, scroll-padding-inline follows the writing mode and direction of the document: in left-to-right horizontal text it corresponds to left/right offsets, while in vertical or right-to-left layouts it maps to the appropriate inline sides. It is commonly used together with the shorthand scroll-padding (which sets both inline and block insets) and with snapping behavior controlled by scroll-snap-type to fine-tune where snap points land relative to the visible area. Importantly, it affects the scroll position calculations and snap alignment, not the size or flow of content.
Practical use cases include horizontal carousels where you want an item centered or inset from edges when scrolled into view, navigable lists where focused elements must remain readable and not obscured by UI chrome, and any layout that must adapt to different writing directions. When pairing scrolling alignment with how individual elements are positioned when brought into view, developers often combine scroll-padding-inline with per-element offsets like scroll-margin-inline so that both the container’s safe area and the element’s own preferred offset are respected. In short, use scroll-padding-inline to control the scroll-port’s inline guard space used by snapping and programmatic scrolling without modifying layout padding.
Definition
- Initial value
- See individual properties
- Applies to
- scroll containers
- Inherited
- no
- Computed value
- See individual properties
- Animatable
- by computed value type
- JavaScript syntax
- object.style.scrollPaddingInline
Interactive Demo
Syntax
scroll-padding-inline: auto | &tl;length-percentage [0,∞]>
Values
- autoThe offset is determined by the user agent. This will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate.
- &tl;length-percentage>An inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.
Example
Browser Support
The following information will show you the current browser support for the CSS scroll-padding-inline property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
