CSS margin-inline-end

The margin-inline-end property in CSS is used to set the margin on the end side of an element. The end side is affected by the direction of the text, so in left-to-right languages like English, the end side is on the right, and in right-to-left languages like Arabic, the end side is on the left.

The syntax for the margin-inline-end property is:

selector {
  margin-inline-end: value;
}

Here is an example where we set the margin-inline-end for a paragraph:

Result:

This is a paragraph with margin on the end side.

In this example, we set the margin-inline-end to 20 pixels for the paragraph, which creates space on the end side of the paragraph's text.

You can also use different units like percentages or ems for the margin-inline-end property. Here is an example using percentages:

Result:

Another paragraph with margin on the end side.

In this example, we set the margin-inline-end to 10% for the paragraph, which creates space on the end side relative to the width of the containing element.

It's important to note that the margin-inline-end property only affects block-level elements. Inline elements will ignore this property.