CSS tutorial: z-index confusion in IE (1)

Source: Internet
Author: User
For the z-index attribute of CSS, see the following introduction:
Z-index: auto | number
Auto: default value.
Number: an integer with no unit. It can be a negative number.
Elements with a large z-index value are superimposed on elements with a small z-index value. For positioning objects that do not specify this attribute, objects with a positive z-index value are placed above it, while objects with a negative z-index value are placed under it.
Note: This property does not apply to window controls, such as select objects.
In IE5.5 +, iframe objects start to support this attribute. In earlier browser versions, the iframe object is a window control, and this attribute is ignored.
The z-index attribute is applicable to positioning elements (objects whose position attribute value is relative, absolute, or fixed). It is used to determine that the positioning element is perpendicular to the display (called the z axis) stack order ).
Each positioning element belongs to a stacking context. The root element forms the root stacking context, while other stacking context is generated by the positioning element (the z-index of the positioning element is defined as a non-auto z-index value ), the positioning sub-element takes the local stacking context as a reference and uses the same rules to determine the cascade order. In addition, stacking context and containing block are not necessarily related.
When the stacking context is the same, the value of z-index is used to determine how to display it. If the value of z-index is the same (that is, the stack level is the same ), it is stacked in the back-to-front order.
When either element is stacked and another element is contained in different stacking context elements, the order of display is determined by the stack level of stacking context. That is to say, in the same stacking context, the order is determined by the z-index of the stacking context. For example:
The positioning element A (z-index: 100) contains the positioning element A1 (z-index: 300), while the positioning element B and the element A sibling relationship (z-index: 200 ). You will find that no matter how big the z-index of A1 is, it will be overwritten by B where z-index is 200, because the z-index of A is only 100.
Read more details: http://www.w3.org/TR/CSS21/visuren.html#z-index

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.