CSS Portal

CSS scroll-padding-block-start Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The scroll-padding-block-start property defines an inset on the start edge of a scroll container's block axis that is used by scrolling and scroll-snapping algorithms to determine where a target should be aligned inside the scrollport. In practice this means the browser will treat the scrolled-to area as if the scrollport begins some distance away from the container's physical edge when aligning elements — useful to ensure content doesn't get hidden under overlays or fixed headers when elements are brought into view. Note that this property influences the scroll alignment behavior and the effective snap area rather than the element's layout padding used for rendering.

Because it is a logical property on the block axis, scroll-padding-block-start is particularly helpful in combination with scroll-snap features and programmatic methods such as element.scrollIntoView(). When you want snapped or programmatic scrolling to stop short of the container's edge (for example, to leave room for a persistent UI element), setting this property creates that offset for alignment and snapping calculations without changing the visual box model. It is commonly used where you might otherwise try to adjust content positioning with margins or additional wrapper elements; the property keeps those adjustments isolated to scrolling behavior and snap calculations. For shorthand management of multiple edges you can use scroll-padding, and its counterpart for the far side is scroll-padding-block-end.

Because it is a logical property, the meaning of "block-start" depends on the element's writing mode and direction — it maps to whatever physical edge represents the start of the block flow in the current writing-mode, so your offsets are writing-mode–aware and work consistently for vertical or horizontal text flows. The property applies per scroll container (the element that establishes a scroll formatting context), so nested or independent scrolling regions each get their own scroll padding. If you use scroll snapping on a container, this property interacts directly with the container's snap behavior and configuration; consider it alongside scroll-snap-type when tuning how elements land during snapping and programmatic scrolling.

Definition

Initial value
auto
Applies to
scroll containers
Inherited
no
Computed value
as specified
Animatable
by computed value type
JavaScript syntax
object.style.scrollPaddingBlockStart

Interactive Demo

1
2
3
Scroll »

Syntax

scroll-padding-block-start: auto | <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.
  • <length-percentage>An inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.

Example

<body>
<header class="site-header">
<nav class="nav">
<a href="#section1">Section 1</a>
<a href="#section2">Section 2</a>
<a href="#section3">Section 3</a>
</nav>
<span class="header-title">Fixed header - 80px</span>
</header>

<main class="page">
<section id="section1" class="panel">
<h2>Section 1</h2>
<p><a href="#section3">Jump to Section 3</a></p>
</section>

<section id="section2" class="panel">
<h2>Section 2</h2>
<p><a href="#section1">Back to Section 1</a></p>
</section>

<section id="section3" class="panel">
<h2>Section 3</h2>
<p><a href="#section2">Back to Section 2</a></p>
</section>
</main>
</body>
html {
  scroll-padding-block-start: 80px; /* reserve space for fixed header when using fragment links or scroll snapping */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: #222;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(90deg, #4b6cb7, #182848);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 10;
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.header-title {
  margin-left: auto;
  opacity: 0.9;
  font-size: 14px;
}

.page {
  padding-top: 16px;
}

.panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 24px;
  color: #fff;
}

#section1 { background: #ff7e7e; }
#section2 { background: #7ed6ff; }
#section3 { background: #b39cff; }

Browser Support

The following information will show you the current browser support for the CSS scroll-padding-block-start 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
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!