Understanding and application of three positions in CSS format and layout, css layout

Source: Internet
Author: User

Understanding and application of three positions in CSS format and layout, css layout

The first type of location relationship: position: fixed locking position (relative to the entire browser), usually in the lower right corner of each major website or other locations of small ads.

To adjust the lock position, use the following method: <div>Position: fixed;Top: 0px; left: 0px; right: 0px; bottom: 0px"> </Div>

The second type of location relationship: position: absolute position (relative to the parent-level element-browser, absolutely positioned superior)

(1) If the outermost side does not have absolute, the div changes relative to the browser when the adjustment is made. (2) If the outermost side has absolute, the div changes relative to the outermost layer boundary when the adjustment is made.

To adjust the absolute position, use the following method: <div>Position: absolute;Top: 0px; left: 0px; right: 0px; bottom: 0px"> </Div>

Third location relationship: position: relative location of relative (relative to the location where it should appear)

To adjust the relative position, use the following method: <div>Position: relative;Top: 0px; left: 0px; right: 0px; bottom: 0px"> </Div>

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.