scroll-margin

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

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

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

初始值0
适用元素all elements
是否是继承属性
计算值as specified
Animation typeby computed value type

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 Full support 79Firefox Full support 68IE No support NoOpera Full support 56Safari Partial support 11
Notes Alternate Name
Partial support 11
Notes Alternate Name
Notes Scroll margin is not applied for scrolls to fragment target or scrollIntoView(), see bug 189265.
Alternate Name Uses the non-standard name: scroll-snap-margin
WebView Android Full support 69Chrome Android Full support 69Firefox Android Full support 68Opera Android Full support 48Safari iOS Partial support 11
Notes Alternate Name
Partial support 11
Notes Alternate Name
Notes Scroll margin is not applied for scrolls to fragment target or scrollIntoView(), see bug 189265.
Alternate Name Uses the non-standard name: scroll-snap-margin
Samsung Internet Android Full support 10.0

Legend

Full support  
Full support
Partial support  
Partial support
No support  
No support
See implementation notes.
See implementation notes.
Uses a non-standard name.
Uses a non-standard name.