CSS margin-inline

Previous Next

Demo of the different values of the margin-inline property.

Click the property values below to see the result:

margin-inline: 0;
margin-inline: 10px;
margin-inline: -25px;
margin-inline: 50px;
margin-inline: auto;
margin-inline: 5%;
margin-inline: 10px 50px;

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Red div elements are shown to highlight the inline margin at the start and end of the blue div element.

div
Blue div with different margin-inline values.
div

Play more with the code in our Tryit yourself editor: Try it Yourself ❯