scroll-margin-block-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-margin-block-end 属性定义了滚动吸附区域在的块末外边距,此区域用于将此盒吸附至滚动口。滚动吸附区域的确定方法为:取变换后的边框盒,求其矩形包围盒(与滚动容器的坐标空间中的轴对齐),再加上指定的外边距。

尝试一下

语法

css
/* <length> 值 */
scroll-margin-block-end: 10px;
scroll-margin-block-end: 1em;

/* 全局值 */
scroll-margin-block-end: inherit;
scroll-margin-block-end: initial;
scroll-margin-block-end: revert;
scroll-margin-block-end: revert-layer;
scroll-margin-block-end: unset;

取值

<length>

滚动容器的块末外边距。

形式定义

初始值0
适用元素所有元素
是否是继承属性
计算值as specified
动画类型按计算值的类型

形式语法

scroll-margin-block-end = 
<length>

规范

Specification
CSS Scroll Snap Module Level 1
# margin-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-margin-block-end

Legend

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

Full support
Full support

参见