CSS HTML Validator - The All-In-One HTML, CSS, Link, SEO, spelling, and Accessibility Checker
Home Help: "margin" CSS property

The "margin" CSS Property

information note NOTE: A summer-time offer is available. Email us at deal@htmlvalidator.com with "Summer promo" in the subject.


This shorthand property sets the margin for all four sides. Margin values may be negative.

Values for "margin"
CSS LevelValue
CSS 2.1"[ <length> | <percentage> | auto ]{1,4}"
CSS3"[ <length> | <percentage> | auto ]{1,4}"

Syntax Notes for "margin"

  • Specify the margins in this order: top, right, bottom, left.
  • If only one value is supplied, then it applies to the top, right, bottom, and left margins. If only two values are supplied, then the first value applies to the top and bottom margins and the second value applies to the right and left margins.

Recommended Links

Search Engine Links (for more information)

Help us improve this page: Suggest a link or noteReport a problem