
Properties set on elements that cause anonymous block boxes to be The font of the anonymous box is inherited from the DIV, but the Non-inherited properties have their initial value. The properties of anonymous boxes are inherited from theĮnclosing non-anonymous box (e.g., in the example just below the subsection heading "Anonymous block boxes", the one for DIV). The resulting boxes would be a block box representing the BODY,Ĭontaining an anonymous block box around C1, the SPAN block box, and The P element contains a chunk (C1) of anonymous text followedīy a block-level element followed by another chunk (C2) of anonymous This model would apply in the following example if the following To make itĮasier to define the formatting, we assume that there is an anonymous block box (and assuming the DIV and the P both have 'display: block'), theĭIV appears to have both inline content and block content. "block box" are sometimes abbreviated as "block" where unambiguous. The three terms "block-level box," "block container box," and Block-level boxes that are also block containers are Not all blockĬontainer boxes are block-level boxes: non-replaced inline blocksĪnd non-replaced table cells are block containers but not block-levelīoxes. Replaced elements, a block-level box is also a block container box.Ĭontains only block-level boxes or establishes an inline formattingĬontext and thus contains only inline-level boxes. Placed with respect to the principal box.Įxcept for table boxes, which are described in a later chapter, and Some block-level elements may generate additional boxes in addition The following values of the 'display' property make an elementīlock-level: 'block', 'list-item', and 'table'.īlock-level element generates a principal block-levelīox that contains descendant boxes and generatedĬontent and is also the box involved in any positioning scheme.

The 'display' property, described below,ĩ.2.1 Block-level elements and block boxesīlock-level elements are those elements of the source document that are formatted visually asīlocks (e.g., paragraphs). A box's type affects, in part, its behavior in the The following sections describe the types of boxes that may be How a containing block's dimensions are calculated are described in

The phrase "a box's containing block" means "theĬontaining block in which the box lives," not the one it generates.Įach box is given a position with respect to its containing block,īut it is not confined by this containing block it may overflow. General, generated boxes act as containing blocks for descendantīoxes we say that a box "establishes" the containing block for itsĭescendants. Of a rectangular box called a containing block. In CSS 2.1, many box positions and sizes are calculated with respect The document is rendered, the user agent should offer a scrollingĪgents may render to more than one canvas (i.e., provide different When the viewport is smaller than the area of the canvas on which Viewport is resized (see the initial containing block). User agents may change the document's layout when the Viewing area on the screen) through which users consult aĭocument. Generally offer users a viewport (a window or other Conforming user agents may behaveĭifferently for those formatting issues not covered by this The visual formatting model does not specify all aspects ofįormatting (e.g., it does not specify a letter-spacing algorithm). Properties vary when applied to paged media (see the page model for details). The properties defined in this chapter and the next apply to both external information (e.g., viewport size, intrinsic dimensions of images, etc.).(normal flow, float, and absolute positioning). The layout of these boxes is governed by: Generates zero or more boxes according to the box In the visual formatting model, each element in the document tree This chapter and the next describe the visual formatting model: how user 9.1 Introduction to the visual formatting model The CSS Working Group is also developing CSS level 2 revision 2 (CSS 2.2). Please, see "Cascading Style Sheets (CSS) - The Official Definition" in the latest CSS Snapshot for a list of specifications and the sections they replace. Note: Several sections of this specification have been updated by other specifications. 9.10 Text direction: the 'direction' and 'unicode-bidi' properties.9.9.1 Specifying the stack level: the 'z-index' property.9.8 Comparison of normal flow, floats, and absolute positioning.9.7 Relationships between 'display', 'position', and 'float'.9.5.2 Controlling flow next to floats: the 'clear' property.9.5.1 Positioning the float: the 'float' property.9.3.1 Choosing a positioning scheme: 'position' property.9.2.2 Inline-level elements and inline boxes.9.2.1 Block-level elements and block boxes.

9.1 Introduction to the visual formatting model.
