Name

margin-right

Synopsis

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

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

Get Cascading Style Sheets: The Definitive Guide, Second 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.