-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
53 lines (35 loc) · 1.19 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: scroll-margin-top
slug: Web/CSS/scroll-margin-top
page-type: css-property
browser-compat: css.properties.scroll-margin-top
---
{{CSSRef}}
The `scroll-margin-top` property defines the top 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.
{{EmbedInteractiveExample("pages/css/scroll-margin-top.html")}}
## Syntax
```css
/* <length> values */
scroll-margin-top: 10px;
scroll-margin-top: 1em;
/* Global values */
scroll-margin-top: inherit;
scroll-margin-top: initial;
scroll-margin-top: revert;
scroll-margin-top: revert-layer;
scroll-margin-top: unset;
```
### Values
- {{CSSXref("<length>")}}
- : An outset from the top edge of the scroll container.
## Formal definition
{{cssinfo}}
## Formal syntax
{{csssyntax}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [CSS scroll snap](/en-US/docs/Web/CSS/CSS_scroll_snap)
- [Well-controlled scrolling with CSS scroll snap](https://web.dev/articles/css-scroll-snap)