The concept of document flow layout:
The document flows by dividing the form from top to bottom into rows and emitting elements from left to right in each row.
Each non-floating block-level element is exclusive to one row, and the floating element floats at one end of the row as specified. If the current line does not fit, a new row is floated again. Inline elements also do not monopolize a single row. Almost all elements, including block-level, inline, and list elements, can generate child rows for placing child elements. There are three situations that will cause elements to flow out of the document, floating, absolute positioning, fixed positioning. However, floating elements in IE6 also exist in the document flow.
Detailed Description:
For example, the div tag of a Web page, which occupies a whole row by default, and the P label is a full line by default, because div tags and p tags are block objects.
Most objects in a Web page use document flow by default, and some objects do not account for document flow, such as hidden fields in a form.
Of course, we can also let the elements that occupy the flow of documents into the document flow, which will be used in the CSS property position to control. Look at the definition of CSS 2.0 for position: Retrieves how objects are positioned. A total of 5 values are taken. Static: Default value, no special (static) positioning. Object follows the HTML targeting rules. Absolute: absolute positioning. Drag objects from the document stream and use attributes such as left,right,top,bottom to absolutely position them relative to their closest parent object with positioning settings. If no such parent object exists, then the body object is based. And its cascade is defined by the Z-index property. When the object is positioned outside the browser window, the browser displays the scroll bar. Fixed: stationary positioning. Object positioning is in absolute (absolute) mode. But there are some rules to follow. When the object is positioned outside the browser window, the browser does not display the scroll bar, and when the ScrollBar scrolls, the object is always pinned to its original position. Relative: relative positioning. Objects are not stackable, but they will be offset in the normal document flow based on attributes such as Left,right,top,bottom. When the object is positioned outside the browser window, the browser displays the scroll bar. Inherit: An inherited value that inherits the corresponding value of its parent object.
CSS Document Flow Layout