22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9.2 Controlling box generation<br />

The following sections describe the types of boxes that may be generated in<br />

<strong>CSS2</strong>. A box’s type affects, in part, its behavior in the visual formatting model.<br />

The ’display’ property, described below, specifies a box’s type.<br />

9.2.1 Block-<strong>level</strong> elements and block boxes<br />

Block-<strong>level</strong> elements are those elements of the source document that are formatted<br />

visually as blocks (e.g., paragraphs). Several values of the ’display’ property<br />

make an element block-<strong>level</strong>: ’block’, ’list-item’, ’compact’ and ’run-in’ (part of the<br />

time; see compact [p. 99] and run-in boxes [p. 100] ), and ’table’.<br />

Block-<strong>level</strong> elements generate a principal block box that only contains block<br />

boxes. The principal block box establishes the containing block [p. 96] for<br />

descendant boxes and generated content and is also the box involved in any<br />

positioning scheme. Principal block boxes participate in a block formatting<br />

context [p. 105] .<br />

Some block-<strong>level</strong> elements generate additional boxes outside of the principal<br />

box: ’list-item’ elements and those with markers [p. 164] . These additional boxes<br />

are placed with respect to the principal box.<br />

Anonymous block boxes<br />

In a document like this:<br />

<br />

Some text<br />

More text<br />

<br />

(and assuming the DIV and the P both have ’display: block’), the DIV appears to<br />

have both inline content and block content. To make it easier to define the<br />

formatting, we assume that there is an anonymous block box around "Some<br />

text".<br />

DIV box<br />

anonymous box<br />

Some text<br />

More text<br />

P box<br />

Diagram showing the three boxes, of which one is anonymous, for the example<br />

above.<br />

97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!