English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
face rule
CSS Visual Formatting ModelThe CSS visual formatting model is an algorithm used to process visual media documents. In the visual formatting model, each element in the document tree will be processed according toBox Model
Generate zero or more boxes.
The layout of these boxes depends on the following factors:
Box Size.
The type of the element (block or inline).Positioning Scheme (Normal Flow,FloatingandAbsolute Positioning
)
The relationships between elements in the document tree.
Note:External information, such as viewport size, the intrinsic size of images, etc.
Types of Boxes Generated in CSS
Block-level elements and block boxesBlock-level elements are those elements that are visually formatted as blocks (i.e., occupy the full available width) and have line breaks before and after the element. For example, paragraph elements (<p>such as headings (1<h - such as headings (6<h>such as separators (such as div (
Generally, block-level elements can contain inline elements and other block-level elements.
Inline-level elements are those elements that do not constitute a new content block in the source document; content is distributed line by line. For example, paragraph elements (<em>such as span (<span>such as strong elements (<strong>such as emphasized text within parentheses, etc.
Inline elements usually can only contain text and other inline elements.
Note:Unlike block-level elements, inline-level elements only occupy the necessary width and do not force line breaks.
You can use the CSS display property to change the display way of elements on the web page. You will learnIn the next chapterUnderstand the display property.