Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions content/css/concepts/margins/terms/margin-block/margin-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# margin-block

The `margin-block` CSS property defines the logical block-start and block-end margins of an element. It is used to control vertical spacing in writing modes where the block direction may vary, such as top-to-bottom or right-to-left layouts.

## Syntax

margin-block: <start> <end>;
- `<start>`: sets the margin at the start of the block (top in normal writing mode)
- `<end>`: sets the margin at the end of the block (bottom in normal writing mode)

## Example
```
.box {
margin-block: 10px 20px;
}
```
In this example, the `.box` element will have a 10px margin at the start of the block and a 20px margin at the end of the block.

> [!NOTE]
> `margin-block` is a logical property and will adapt based on writing mode, unlike `margin-top` and `margin-bottom`.