- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS scroll-padding-block-end Enhance Scrolling Experiences
Use keywords like 'auto', lengths, and percentages to control padding at the end of scroll containers.

## Introduction
The `scroll-padding-block-end` property in CSS is a handy tool for web developers. It helps you set the space at the end of a scrollable area. This is great for making sure content isn’t hidden by fixed elements like toolbars.
Introduced in July 2019, this feature works well on many devices and browsers. Using `scroll-padding-block-end` improves the user experience by keeping important content visible. It’s essential for modern web design to control scrolling behavior effectively.
## Description
The `scroll-padding-block-end` property sets the space at the end of a scrollable area. It helps keep content visible by adding extra space, ensuring it doesn’t get hidden behind fixed elements like toolbars or sidebars.
This is especially useful in modern web design with fixed navigation bars. By adjusting `scroll-padding-block-end`, you can create a user-friendly interface where important content stays visible. This property works well with different writing modes, making it versatile.
## Specification
The `scroll-padding-block-end` property is defined in the CSS Scroll Snap Module Level 1 specification. This module includes various properties to control scrolling behaviors. The specification outlines how to use this property, ensuring consistency across different browsers and platforms.
By following the guidelines in the CSS Scroll Snap Module Level 1, web developers can create smooth and predictable scrolling experiences.
## Syntax
The `scroll-padding-block-end` property in CSS can be set using various values:
```css/* Keyword values */scroll-padding-block-end: auto;
/* <length> values */scroll-padding-block-end: 10px;scroll-padding-block-end: 1em;scroll-padding-block-end: 10%;
/* Global values */scroll-padding-block-end: inherit;scroll-padding-block-end: initial;scroll-padding-block-end: revert;scroll-padding-block-end: revert-layer;scroll-padding-block-end: unset;
Property Values
- Keyword Values (
auto
):- The
auto
value lets the browser decide the space. It’s usually0px
, but the browser can adjust it as needed.
- The
- Length Values (
<length-percentage>
):- You can set the space using units like pixels (
px
), ems (em
), or percentages (%
).
- You can set the space using units like pixels (
- Global Values:
- These include
inherit
,initial
,revert
,revert-layer
, andunset
. They help you apply styles based on the parent element or reset the property.
- These include
Values
The scroll-padding-block-end
property accepts various values:
Keyword Values
auto
:- The browser decides the space. This is usually
0px
, but it can be adjusted for optimal viewing.
- The browser decides the space. This is usually
Length Values
<length-percentage>
:- You can set the space using units like pixels (
px
), ems (em
), or percentages (%
). - Examples:
scroll-padding-block-end: 10px;
scroll-padding-block-end: 1em;
scroll-padding-block-end: 10%;
- You can set the space using units like pixels (
Global Values
inherit
:- The element inherits the value from its parent.
initial
:- Resets the property to its initial state, which is
auto
.
- Resets the property to its initial state, which is
revert
:- Resets the property to the user agent’s default style, usually
auto
.
- Resets the property to the user agent’s default style, usually
revert-layer
:- Resets the property to the value specified in the previous cascade layer.
unset
:- Resets the property to its natural value, either
inherit
orinitial
.
- Resets the property to its natural value, either
Formal Definition
Initial Value:
- The initial value for
scroll-padding-block-end
isauto
.
Applies To:
- This property applies to scroll containers.
Inherited:
- No, the property is not inherited from parent elements.
Percentages:
- Percentages are relative to the scroll container’s scrollport.
Computed Value:
- The computed value is as specified.
Animation Type:
- The animation type is by computed value type.
Formal Syntax:
scroll-padding-block-end = auto | <length-percentage>
<length-percentage> = <length> | <percentage>
Specifications
- The
scroll-padding-block-end
property is defined in the CSS Scroll Snap Module Level 1:- [CSS Scroll Snap Module Level 1]WebsiteUrl
Browser Compatibility
The scroll-padding-block-end
property is widely supported across many devices and browsers. Here’s an overview:
- Google Chrome: Version 69 and later
- Mozilla Firefox: Version 68 and later
- Apple Safari: Version 15 and later
- Microsoft Edge: Version 79 and later
- Opera: Version 56 and later
Example
Here’s a simple example to see scroll-padding-block-end
in action. We’ll set the scroll-padding-block-end
to 90px
, ensuring content within the scroll container has sufficient space.
HTML
<!DOCTYPE html><html><head> <style> .geek { width: 275px; height: 300px; border: solid greenyellow; color: white; display: flex; justify-content: center; align-items: center; font-size: 50px; scroll-snap-align: end none; }
.Website { width: 300px; height: 300px; border: 2px solid green; text-align: center; overflow-x: hidden; overflow-y: auto; white-space: nowrap; scroll-snap-type: y mandatory; } </style></head><body> <div class="Website" style="scroll-padding-block-end: 90px;"> <div class="geek" style="background-color:darkgreen;"> Geeks </div> <div class="geek" style="background-color:rgb(129, 245, 21);"> for </div> <div class="geek" style="color:green;"> Geeks </div> <div class="geek" style="background-color:rgb(115, 223, 43);"> for </div> <div class="geek" style="color:green;"> Geeks </div> <div class="geek" style="color:black;"> for </div> </div></body></html>
Output
When you scroll through the content, you’ll notice a 90px
padding at the end of the scroll container. This ensures the last element has enough space and isn’t hidden.
![Example GIF]WebsiteUrl
This example shows how scroll-padding-block-end
can enhance the user experience by keeping content visible and unobstructed within a scroll container.






Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.