scroll-margin

翻译不完整。 请帮助我们翻译这篇文章!

scroll-margin 属性是修改一系列 scroll-margin 手写特性的快捷方式, 它分配值的方式与 margin 属性为各个 margin-* 手写特性分配值的方式非常类似。

scroll-margin 属性的值代表用于将盒元素拖拽到显示区域的拖拽滚动区域的起点。拖拽滚动区域由是由转换后边框大小的盒元素决定的,它会找到盒元素的矩形边界(在滚动的容器的坐标空间轴上),并添加指定的起点。

初始值0
适用元素all elements
是否是继承属性
适用媒体visual
计算值as specified
Animation typeby computed value type
正规顺序per grammar

Syntax

/* <length> values */
scroll-margin: 10px;
scroll-margin: 1em .5em 1em 1em;

/* Global values */
scroll-margin: inherit;
scroll-margin: initial;
scroll-margin: unset;

Values

<length>
从滚动容器的相应边缘开始。

Formal syntax

<length>{1,4}

Specification

Specification Status Comment
CSS Scroll Snap Module Level 1
scroll-margin
Candidate Recommendation Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
scroll-marginChrome Full support 69Edge No support NoFirefox Full support 68IE No support NoOpera Full support 56Safari Full support 11WebView Android Full support 69Chrome Android Full support 69Firefox Android Full support 68Opera Android Full support 48Safari iOS Full support 11Samsung Internet Android Full support 10.0

Legend

Full support  
Full support
No support  
No support