Experience in using the position attribute

Source: Internet
Author: User

Experience in using the position attribute

1. Use absolute in position to work with relative. If relative is not used, absolute uses the entire window as the reference. If relative is placed on the parent label of absolute, then, absolute uses the parent block label as the reference object to adjust the position. absolute uses the top, left, right, and bottom attributes to adjust the position.

2. the position fiexed is fixed. Problems I encountered during use:

,

There is a problematic picture above, and the navigation bar is not fixed to the top.

Note: In the test, the position in the above image is fiexed instead of relative.

 

Because the position fiexed is not added with top: 0, it is not fixed to the top.

After top is added, my navigation bar becomes normal and will not leak a slit like that

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.