CSS Document Flow Layout

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.