scroll-padding-inline

A shorthand that sets both the start and end scroll padding in the horizontal (inline) direction on a container.

It is documented as part of the CSS Scroll Snap specification.

/* Usage Example */
.image-scroller {
  /* Adds a 1rem safe zone on both the left and right sides of the container */
  scroll-padding-inline: 1rem;
}

/* Syntax */
scroll-padding-inline: auto;

/* Global values */
scroll-padding-inline: inherit;
scroll-padding-inline: initial;
scroll-padding-inline: revert;
scroll-padding-inline: revert-layer;
scroll-padding-inline: unset;
Widely available Since 2020 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

69+
68+
15+
79+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC