B.63. margin

This property sets the size of the margins surrounding the selected element(s).

The size for each side may be set individually using the margin-bottom, margin-left, margin-right, and margin-top properties.

Inherited: No

See also: Section B.64margin-bottom, Section B.64margin-left, Section B.64margin-right, Section B.64margin-top

B.63.1. Value

You can specify from one to four different values to specify different margin sizes for each side of the element, as shown in Table B-6.

Each value can be a CSS length (px, pt, em, etc.), a percentage of the parent element's width (even for the top and bottom margins[9]), or the auto constant, which tells the browser automatically to calculate and use a margin that will allow the element ...

Get HTML Utopia: Designing Without Tables Using CSS 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.