CSS scroll-padding-inline-end Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Logical Properties

What You’ll Learn

The scroll-padding-inline-end property insets the scrollport at the inline-end edge of a scroll container. It helps ensure content is not too close to the trailing inline edge when scrolling or scroll snapping.

01

inline-end

Logical trailing edge.

02

inset

Scrollport space.

03

length

px, rem, %.

04

container

On scroll box.

05

carousel

Trailing inset.

06

snap

Last slides.

Introduction

The scroll-padding-inline-end property in CSS is part of the CSS Scroll Snap Module. It allows you to define inset at the inline-end of a scroll container’s scrollport, ensuring that content is not too close to the trailing edge when it is scrolled into view.

This property is especially useful for horizontal carousels, overflow panels, and any scroll container where the last item should not sit flush against the inline-end edge.

Definition and Usage

Apply scroll-padding-inline-end to the scroll container — such as a horizontal carousel with overflow-x: auto and scroll snapping enabled.

It is one longhand of the scroll-padding-inline shorthand. Use it when only the inline-end side of the scrollport needs inset.

💡
Beginner Tip

On a normal left-to-right webpage, scroll-padding-inline-end: 20px insets the right side of the scrollport so the last slide stops before the container edge.

📝 Syntax

The syntax for the scroll-padding-inline-end property is straightforward. It can be applied to any scroll container.

syntax.css
element {
  scroll-padding-inline-end: length | percentage | auto;
}

Basic Example

inline-end.css
.scroll-container {
  scroll-padding-inline-end: 20px;
}

Related Properties

  • scroll-padding-inline-start — inset at the inline-start edge
  • scroll-padding-inline — shorthand for start and end
  • scroll-padding-right — physical right inset

🎯 Default Value

The default value of the scroll-padding-inline-end property is auto, which means the user agent determines the padding based on its default settings unless you specify a length or percentage.

⚡ Quick Reference

QuestionAnswer
Default valueauto
Horizontal writing modeUsually right scrollport inset in LTR
Part ofscroll-padding-inline shorthand
Accepted valuesLengths, percentages, auto
Set onScroll containers
InheritedNo
AnimatableNo

💎 Property Values

ValueExampleDescription
lengthscroll-padding-inline-end: 50px;Specifies a fixed amount of inset at the inline-end edge (e.g., 20px, 2em).
percentagescroll-padding-inline-end: 10%;Specifies inset as a percentage of the scroll container’s block dimension.
autoscroll-padding-inline-end: auto;Lets the browser determine the padding automatically.
50px 2rem 10%

When to Use scroll-padding-inline-end

scroll-padding-inline-end helps when the inline-end side of the scrollport needs inset:

  • Last carousel slide — Inset the scrollport so the final slide is not clipped at the trailing edge.
  • Horizontal snap panels — Add space after the last snap stop in a scroller.
  • Overflow boxes — Prevent scrolled content from sitting flush against the container’s inline-end edge.
  • Logical layouts — Prefer inline-end over hard-coded right in RTL-aware sites.

For the inline-start side (usually left in LTR), use scroll-padding-inline-start instead.

👀 Live Preview

Scroll sideways inside the box. The container uses scroll-padding-inline-end: 2rem.

Wide content inside scrollport
Second panel

The scrollport is inset at the inline-end edge so content stops before the trailing side.

Examples Gallery

Start with the reference horizontal scroll example, inset a snap carousel at inline-end, add trailing-edge inset on a carousel, and use the longhand alone on a scroll box.

📜 Inline-End Scrollport Inset

Inset the scrollport at the inline-end edge inside a scroll container — matching the reference example.

Example 1 — scroll-padding-inline-end on a scroll container

In this example, we’ll apply a fixed padding of 20px to the inline-end of a horizontal scroll container.

index.html
<style>
  .container {
    height: 200px;
    overflow-x: scroll;
    scroll-padding-inline-end: 20px;
  }

  .content {
    width: 1000px;
    height: 100px;
    background-color: lightblue;
  }
</style>

<div class="container">
  <div class="content">
    Scroll me and notice the padding on the inline-end side.
  </div>
</div>
Try It Yourself

How It Works

The scroll container’s snap and scroll stop area is inset from the inline-end edge before the browser settles the position.

Example 2 — Snap scroller inline-end inset

Add scroll-padding-inline-end to a horizontal snap container so the last panel does not hug the trailing edge.

snap-scroller.css
.snap-box {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-end: 24px;
}
Try It Yourself

How It Works

Container-level inline-end inset applies to every snap stop inside the horizontal scroll box.

📄 Carousels & Layout Insets

Improve trailing-edge spacing on horizontal carousels and overflow panels.

Example 4 — Inline-end longhand only

When only inline-end needs inset, use the longhand alone: scroll-padding-inline-end: 3rem;.

longhand-only.css
.scroll-panel {
  scroll-padding-inline-end: 3rem;
}
Try It Yourself

How It Works

Equivalent to scroll-padding-inline: 0 3rem; when only inline-end matters.

scroll-padding-inline-end in the family

scroll-padding-inline-end is the inline-end longhand of scroll-padding-inline. For the opposite side, see scroll-padding-inline-start.

shorthand-equivalent.css
/* These are equivalent when only inline-end matters */
.a { scroll-padding-inline-end: 2rem; }
.b { scroll-padding-inline: 0 2rem; }

🧠 How scroll-padding-inline-end Works

1

Scroll container is configured

A scroll box with scroll-padding-inline-end defines inline-end inset for its scrollport.

Container
2

Inline-end edge insets

The browser shrinks the effective snap area away from the container’s inline-end edge.

Inset
3

Content scrolls into place

Snapped or scrolled content lands inside the inset scrollport at inline-end.

Position
=

Comfortable inline-end stops

Trailing content no longer feels cramped against the scrollport edge.

Browser Compatibility

The scroll-padding-inline-end property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Logical scroll padding · Modern support

Reliable inline-end support

Current Chrome, Firefox, Safari, Edge, and Opera support scroll-padding-inline-end on scroll containers.

97% Modern browser support
Google Chrome 69+ · Desktop & Mobile
Full support
Mozilla Firefox 68+ · Desktop & Mobile
Full support
Apple Safari 14.1+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 56+ · Modern versions
Full support

Testing tip

Test horizontal scroll snapping on mobile browsers to confirm inline-end inset clears the last carousel slide.

scroll-padding-inline-end property 97% supported

Bottom line: scroll-padding-inline-end is safe to use in modern projects for scroll containers that need inline-end inset.

Conclusion

The scroll-padding-inline-end property is a valuable addition to the CSS toolkit, providing better control over scroll behavior and padding of scrollable containers.

By adjusting the padding at the inline-end of the scrollport, you can improve the overall user experience, ensuring that content is more readable and visually appealing. Experiment with different values to see how this property can enhance your web designs.

💡 Best Practices

✅ Do

  • Apply scroll-padding-inline-end on the scroll container
  • Use it with horizontal snap scrollers and overflow panels
  • Prefer logical inline-end over hard-coded right when possible
  • Match inset to carousel peek width or trailing UI
  • Test last-slide snap behavior on mobile

❌ Don’t

  • Set it on snap targets instead of the scroll container
  • Confuse it with padding-inline-end layout spacing
  • Assume inline-end always equals right in every writing mode
  • Use huge percentages without testing on small screens
  • Forget inline-start inset when fixed side nav covers leading content

Key Takeaways

Knowledge Unlocked

Five things to remember about scroll-padding-inline-end

Use these points when insetting inline-end scroll containers.

5
Core concepts
02

inline-end

Logical edge.

Axis
03

longhand

One side.

Detail
04

container

Scroll box.

Scope
04

snap

Last slides.

Use case
🔄 05

block

Shorthand pair.

Companion

❓ Frequently Asked Questions

scroll-padding-inline-end insets the scrollport at the inline-end edge of a scroll container. In horizontal left-to-right writing mode, inline-end is usually the right side.
right is a physical direction. inline-end is logical and follows the document inline flow, so it stays correct in RTL and vertical writing modes.
scroll-padding-inline is a shorthand for both inline-start and inline-end insets. scroll-padding-inline-end sets only the inline-end side of the scrollport.
The default value is auto, meaning the browser applies no extra inline-end inset unless you specify a length, percentage, or other value.
Use it on scroll containers when snapped or scrolled content should not sit flush against the inline-end edge, such as for last carousel slides, trailing snap panels, or right inset in horizontal overflow boxes.

Practice in the Live Editor

Open the HTML editor and try scroll-padding-inline-end: 20px on a scroll container.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful