Css positioning, css relative positioning

Source: Internet
Author: User

Css positioning, css relative positioning


Div, h1, or p elements are often called block-level elements. This means that these elements are displayed
Block content, that is, block box ". In contrast, elements such as span and strong are called "rows ".
", Because their content is displayed in the row, that is," inside the line box ".
CSS has three basic Positioning Mechanisms: normal stream, floating, and absolute positioning.
Unless otherwise specified, all frames are located in the normal stream. That is to say, in a normal stream
The position of the element is determined by the position of the element in (X) HTML.
CSS position attribute:
Static relative absolute fixed

Css relative positioning
Absolute positioning makes the element position irrelevant to the Document Stream, so it does not occupy space. This and phase
Unlike positioning, relative positioning is actually considered as part of the normal stream positioning model, because
The position of an element is relative to its position in a normal stream.

Css float
A floating box can be moved to the left or right until its outer edge hits the include box or another
Until the border of the floating box.
Because the floating box is not in the normal stream of the document, the block box in the normal stream of the document is displayed
Just as the floating box does not exist.

Inline: a block-level element in a row.
Block: 1. Hide element display 2. block-level element Conversion
Inline-block: both contain

Related Article

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.