Prev | Current Page 298 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

142), collapsing margins (p. 148),
containing blocks (p. 147), and floating and clearing (p. 180) to understand exactly
SPEC
version initial inherited
CSS1 0 NO
BROWSER SUPPORT
Op9.2+ Saf1.3+ FF1+ IE5.5+
FULL FULL FULL BUGGY
how margins work for all elements. The section on inline formatting (p. 166) also
explains how margins affect inline elements.
Value
The property takes a CSS length (px, pt, em, and so on), the keyword auto, or a
percentage of the width of the element??™s containing block (p. 147). Note that even
for the top and bottom margins the percentage value will refer to the width of the
containing block. If the containing block??™s width depends on the element to which
percentage margins are applied, the resulting layout is undefined in CSS2.1.
Negative values are allowed for margins (although implementation-specific limits
may apply), and have the effect of pulling the element in the direction of the margin
Box Properties
203 Box Properties
specified. This may cause the element to overlap other elements, which may, of
course, be the desired effect.


Pages:
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310