Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Commit 9142e2e

Browse files
Revise margin-inline.md for clarity and examples
Updated the margin-inline documentation to clarify usage and examples.
1 parent 1e93693 commit 9142e2e

1 file changed

Lines changed: 24 additions & 13 deletions

File tree

content/css/concepts/margins/terms/margin-inline/margin-inline.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,48 @@
22
Title: 'margin-inline'
33
Description: 'Defines the logical inline start and end margins for an element.'
44
Subjects:
5-
- 'Web Development'
65
- 'Web Design'
6+
- 'Web Development'
77
Tags:
8-
- 'Margin'
98
- 'Box Model'
9+
- 'Margin'
1010
- 'Positioning'
1111
CatalogContent:
1212
- 'learn-css'
1313
- 'paths/front-end-engineer-career-path'
14-
- 'paths/full-stack-engineer-career-path'
1514
---
1615

17-
Defines the logical inline start and end margins for an element.
16+
The **`margin-inline`** property sets the logical inline-start and inline-end margins of an element. These logical margins adjust automatically based on the element’s writing mode and text direction.
1817

1918
## Syntax
2019

21-
```css
20+
```pseudo
2221
margin-inline: <value>;
2322
```
2423

25-
where `<value>` can be one of the following:
24+
Or, alternatively:
2625

27-
- Length: `20px`
28-
- Percentage: `5%`
29-
- Auto: `auto`
26+
```pseudo
27+
margin-inline: <start> <end>;
28+
```
29+
30+
**Parameters:**
31+
32+
- `<value>`: Specifies the inline margins. Acceptable values include:
33+
- Length values such as `20px`, `2rem`
34+
- Percentage values such as `5%`
35+
- `auto`
36+
- Global values such as `inherit`, `initial`, `unset`, and `revert`
37+
38+
**Return value:**
39+
40+
None. This property sets the inline margins of an element.
3041

3142
> **Note:** This property accepts one or two values. When one value is provided, it applies to both inline-start and inline-end. When two values are provided, the first applies to inline-start and the second to inline-end. Values provided may be negative, placing the element closer.
3243
3344
## Example 1
3445

35-
Set the inline margins of the `h1` element to be `20px`:
46+
This example sets the inline margins of the `h1` element to be `20px`:
3647

3748
```css
3849
h1 {
@@ -42,7 +53,7 @@ h1 {
4253

4354
## Example 2
4455

45-
Set the inline-start margin of the `h1` element to be `10px` and inline-end margin to be `30px`:
56+
This example sets the inline-start margin of the `h1` element to be `10px` and inline-end margin to be `30px`:
4657

4758
```css
4859
h1 {
@@ -52,10 +63,10 @@ h1 {
5263

5364
## Example 3
5465

55-
Set the inline margins of the `h1` element to be `5%`:
66+
The following example sets the inline margins of the `h1` element to be `5%`:
5667

5768
```css
5869
h1 {
5970
margin-inline: 5%;
6071
}
61-
```
72+
```

0 commit comments

Comments
 (0)