Web4College

CSS margin-inline property

src

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

0

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

margin-inline: 0px;
Try it

length

20

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

margin-inline: 20px;
Try it

length

40

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

margin-inline: 20px 40px;
Try it

Applicable to

It applies to all elements