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 CSS-compatible browsers, including Internet Explorer 4 and Netscape 4.

B.64.3. Example

These style rules modify the default margins, assigned by the browser to headings and paragraphs, to make headings "stick to" the first paragraph that follows:

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0;
  margin-top: 12pt;
}
p {
  margin-top: 0;
  margin-bottom: 6px;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset