--- title: scroll-margin-top slug: Web/CSS/scroll-margin-top tags: - CSS - CSS Property - Reference - Web - scorll-margin - scroll-margin-top translation_of: Web/CSS/scroll-margin-top ---
scroll-margin-top
属性定义了滚动捕捉区域的顶边距,用于在捕捉视口上捕捉该盒子。滚动捕捉区域是由变换后的边框决定的,找到它的矩形边界框(在滚动容器的坐标空间轴中轴对齐),然后添加指定的起始点。
/* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* Global values */ scroll-margin-top: inherit; scroll-margin-top: initial; scroll-margin-top: unset;
<length>
{{cssinfo}}
{{csssyntax}}
规范 | 状态 | 注释 |
---|---|---|
{{SpecName("CSS Scroll Snap Points", "#propdef-scroll-margin-top", "scroll-margin-top")}} | {{Spec2("CSS Scroll Snap Points")}} | Initial definition |
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("css.properties.scroll-margin-top")}}