Openwave Mobile Browser 6.1 and 6.2: XHTML Mobile Profile and CSS Reference
Section 25 out of 38 total sections
Current chapter: CSS Reference

You can use the margin properties to add space between an element's border and the edge of the screen or adjacent elements. The color or image of the margin area is set by the containing element, not by the element itself. Elements have no margins unless you set them with the margin properties or they inherit a margin from a parent element.
Margins are described in The CSS Box Model.

Sets the size of the top, right, bottom, or left margin.
em, ex, cm, mm, in, pt, pc, px, %, auto, inherit
For more information, see Units of Measure, Percentage, and Keywords.
Block elements and replaced inline elements (such as <img> and <object>).
Percentage values are relative to the width of the containing block.
Adds 6 points of vertical space above between each <div> element and the element above it, or the top of the screen.

A shorthand property that sets the size of all four margins: all at once, in sets, or individually, as described in The CSS Box Model.
em, ex, cm, mm, in, pt, pc, px, %, auto, inherit
For more information, see Units of Measure, Percentage, and Keywords.
Block elements and replaced inline elements (such as <img> and <object>).
Percentage values are relative to the width of the containing block.
h1 {margin: 6pt}
Adds 6 points between each <h1> element and the elements above and below it, as well as between the left and right edges of the screen.
h1 {margin: 1em 2em}
Sets top and bottom margins to 1 em, right and left margins to 2 ems.

