scroll-padding-inline-end

Baseline Widely available

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

scroll-padding-inline-end プロパティは、スクロールポートの最適表示領域のインライン方向における末尾側のオフセットを定義します。ユーザーのビュー内でものを配置するためのターゲット領域として使用される領域です。これにより、他のコンテンツ (固定位置のツールバーやサイドバーなど) によって隠されているスクロールポートの領域を除外したり、単にターゲット要素とスクロールポートの端との間により多くの余裕を持たせたりすることができます。

試してみましょう

構文

css
/* キーワード値 */
scroll-padding-inline-end: auto;

/* <length> 値 */
scroll-padding-inline-end: 10px;
scroll-padding-inline-end: 1em;
scroll-padding-inline-end: 10%;

/* グローバル値 */
scroll-padding-inline-end: inherit;
scroll-padding-inline-end: initial;
scroll-padding-inline-end: revert;
scroll-padding-inline-end: unset;

<length-percentage>

スクロールポートのインライン方向の末尾側からの内側のオフセットで、有効な長さまたはパーセント値です。

auto

オフセットはユーザーエージェントが決定します。これは一般に 0px になりますが、ゼロ以外の値がもっと適切である場合をユーザーエージェントが検出して、他の値を採用することもできます。

公式定義

初期値auto
適用対象スクロールコンテナー
継承なし
パーセント値スクロールコンテナーのスクロールポートに対する相対値
計算値指定通り
アニメーションの種類計算値の型による

形式文法

scroll-padding-inline-end = 
auto |
<length-percentage [0,∞]>

<length-percentage> =
<length> |
<percentage>

仕様書

Specification
CSS Scroll Snap Module Level 1
# padding-longhands-logical

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
scroll-padding-inline-end
auto

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報