scroll-margin-right property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

句法

/* <length> values */
scroll-margin-right: 10px;
scroll-margin-right: 1em;
/* Global values */
scroll-margin-right: inherit;
scroll-margin-right: initial;
scroll-margin-right: unset;
					

<length>

An outset from the right edge of the scroll container.

形式定义

初始值 0
适用于 所有元素
继承 no
计算值 如指定
动画类型 by computed value type

形式句法

<length>
					

规范

规范 状态 注释
CSS Scroll Snap Module Level 1
The definition of 'scroll-margin-right' in that specification.
候选推荐 初始定义

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
scroll-margin-right Chrome 完整支持 69 Edge 完整支持 79 Firefox 完整支持 68 IE 不支持 No Opera 完整支持 56 Safari 部分支持 11 注意事项 Alternate Name
部分支持 11 注意事项 Alternate Name
注意事项 Scroll margin is not applied for scrolls to fragment target or scrollIntoView() ,见 bug 189265 .
Alternate Name Uses the non-standard name: scroll-snap-margin-right
WebView Android 完整支持 69 Chrome Android 完整支持 69 Firefox Android 完整支持 68 Opera Android 完整支持 48 Safari iOS 部分支持 11 注意事项 Alternate Name
部分支持 11 注意事项 Alternate Name
注意事项 Scroll margin is not applied for scrolls to fragment target or scrollIntoView() ,见 bug 189265 .
Alternate Name Uses the non-standard name: scroll-snap-margin-right
Samsung Internet Android 完整支持 10.0

图例

完整支持

完整支持

部分支持

部分支持

不支持

不支持

见实现注意事项。

见实现注意事项。

使用非标名称。

使用非标名称。

元数据

  • 最后修改: