IE7 Z-index failure

Source: Internet
Author: User

Solution:

Add position: relative to the parent element, and set Z-index.

The Z-index of the parent element takes precedence. The Z-index of the contained element is relative to the index of the parent element.

<Div style = "position: relative; Z-Index = 2">

<P style = "position: absolute; Z-Index = 99">... (content to be displayed on the upper layer) </P>

<Div>

<Div style = "position: relative; Z-Index = 1">

...

<Div>

In the above example, if the Z-index of the first div is set to-1, no matter how many Z-index of P is, most of them will be covered by the following Div.

On the contrary, if the Z-index of the lower div is set to 2, when IE7 is interpreting it, it will automatically overlay it according to the order of the "position: relative" layer, that is, the actual value is 3.

If the position attribute is not added, all values are inherited from the parent level.

IE7 Z-index failure

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.