Name

margin-right

Values:

<length> | <percentage> | auto | inherit

Initial value:

0

Applies to:

All elements.

Inherited:

No.

Percentages:

Refer to the width of the containing block.

Computed value:

For percentages, as specified; for length values, the absolute length.

Description:

This sets the width of the right margin for an element. Negative values are permitted, but caution is warranted.

Examples:

img {margin-right: 30px;}
ol {margin-right: 5em;}

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.