B.64. margin-bottom, margin-left, margin-right, margin-top

These properties let you set sizes of the individual margins around an element.

Inherited: No

See also: Section B.63margin

B.64.1. Value

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), or the auto constant, which tells the browser automatically to calculate and use a margin that will allow the element to assume its default (or assigned) width.

Initial value: 0[10]

[10] This initial value is for generic elements. Browsers use an internal style sheet that defines default margins for elements such as headings, paragraphs, block quotes, and list items.

B.64.2. Compatibility

CSS Version: 1

Works in all ...

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.