Absolute, relative, toggle (), relativetoggle

Source: Internet
Author: User

Absolute, relative, toggle (), relativetoggle
The test code is as follows:

<Div> <div class = "global"> do not apply the style </div> <div class = "global abs"> The position is: absolute </div> <div class = "global rel"> location: relative </div>
The difference between the two is: 1. absolute does not occupy the position, and relative occupies the position (usually absolute is used to configure z-index) (The div of abs is overwritten by the div of the rel below. You can use z-index to display abs) 2. by default (top, left, right, bottom is not specified, and only absolute is set), the position is determined by the parent container. combined with top, left, right, and bottom, the location of absolute is determined based on the browser window, and relative is determined based on its own baseline (adding the top: 10px attribute to the two divs, it can be seen that abs [jump up] is determined by the window, and rel is determined by its own baseline) 4. when combining top, bottom, right, left, and other attributes, if you want to use the parent layer as the baseline for absolute (absolute positioning, you can apply the absolute or relativ attribute to the parent layer! (Add position: absolute to the parent div .)
From the figure, we can see why, but the specific situation still needs to be debugged.
You can use $ (obj). toggle () to hide and hide a location.

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.