CSS2.0 position attribute

Source: Internet
Author: User
The position attribute can be used to place element elements in static, relative, absolute, and fixed.
The position attribute has no inheritance.
Possible Values of Possible Values
Static
The element is placed in a normal position (according to the normal flow). With the value of "static" we do not use the "left" and "top" properties
Elements are placed in the normal form (in the normal drooping form ). The "left" and "top" attributes cannot be used when static values are used.
Relative
Moves an element relative to its normal position, so "left: 20" adds 20 pixels to the element's LEFT position
Move the element relative to its original position. Therefore, "left: 20" increases the left position of the element by 20 pixels.
Relative is relative positioning, and its reference point is that the element should have been located. For example, if the three elements a B c are discharged on the webpage, if the css style set for B is position as relative and A positive left value is given, then B can be displayed on the right of C. This positioning of relative is quite strange. It was originally thought that it was relative to something else, and it was wrong yesterday. Because "this element should have been in place" is hard to figure out when designing a webpage, the relative method is not easy to use. If it is difficult to do so, the webpage will be messed up.
Absolute
With a value of "absolute" the element can be placed anywhere on a page. the element's position is specified with the "left", "top", "right", and "bottom" properties
You can use the "absolute" value to place the elements in any position on the page. The positioning of an element depends on the settings of "left", "top", "right", and "bottom.
Absolute is absolute positioning, that is, the coordinates of the current element are expressed relative to the upper left corner of the element. The upper level is the whole page, or a DIV nested in the outer layer. The TD and other elements in the table will not become the upper layer. That is to say, if you want to use the upper-left corner of the current cell as a reference, absolute positioning is not acceptable.

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.