CSS margin-inline property

Description

It is a logical property that defines space at the start and end sides of a inline. The selection of start side depends on the writing-mode.

  • It behaves like margin-top and margin-bottom for the horizontal-tb writing mode.

  • It behaves like margin-right and margin-left for the vertical-* writing-mode respectively.

Change the direction of flow of text.

horizontal-tb vertical-lr vertical-rl

Syntax

margin-inline : margin-inline-start    margin-inline-end

Property values

lengthDefault

Both the margin-inline-start and margin-inline-end are set to 0px.

margin-inline: 0px;

length

Both the margin-inline-start and margin-inline-end are 20px.

margin-inline: 20px;

length

The margin-inline-start and margin-inline-end values are 20px and 40px respectively.

margin-inline: 20px 40px;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?

 
Check the behavior of margin-inline-start for different values of writing mode.
content after the inline
×

Ctrl+D