aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/scroll-margin-block/index.md
blob: b78fd009a4b094c18051e34ba9db544b559d6e9f (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
---
title: scroll-margin-block
slug: Web/CSS/scroll-margin-block
tags:
  - CSS
  - recipe:css-shorthand-property
  - scroll-margin-block
browser-compat: css.properties.scroll-margin-block
---
{{CSSRef}}

The `scroll-margin-block` [shorthand property](/en-US/docs/Web/CSS/Shorthand_properties) sets the scroll margins of an element in the block dimension.

{{EmbedInteractiveExample("pages/css/scroll-margin-block.html")}}

## Constituent properties

This property is a shorthand for the following CSS properties:

- [`scroll-margin-block-end`](/en-US/docs/Web/CSS/scroll-margin-block-end)
- [`scroll-margin-block-start`](/en-US/docs/Web/CSS/scroll-margin-block-start)

## Syntax

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

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

### Values

- `<length>`
  - : An outset from the corresponding edge of the scroll container.

## Description

The scroll-margin values represent outsets defining 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.

## 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/css-scroll-snap/)