Default value of z-index_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:14:08
Original
3129 people have browsed it

What are the default z-index values ​​of ordinary elements and positioned elements in different browsers? If the information is longer, please provide a link. Thank you very much!


Reply to discussion (solution)

1. The default z-index in IE is: z-index:0; while FF The default is: z-index:auto;

It is this difference under IE/FF that leads to different performances of z values ​​under ie and ff.


2. Under normal circumstances: Brothers (same level) elements latter stand up, and the father and son are higher than the father.



3. For positioned elements, (whether IE or FF), the Z value comparison between non-sibling relationship and non-parent-child relationship elements needs to be traced back to the two siblings. On each ancestor element, first compare the z-index values ​​of these two elements. Only when the z-index of "brother" is greater than the z-index value of "brother", can each descendant element of "brother" exceed the "brother element" and its descendant elements.


4. For IE, the default z-index value of the element is 0. If the z-index value of the "brother" and "brother" elements is not set separately, then the z-index value of "brother" The index cannot be greater than the z-index of "brother". Then the "brother" element and its descendants cannot overshadow the "brother" element and its descendants. Once the z-index of "brother" is greater than the z-index of the "brother" element, the situation is reversed. The "brother" element and its descendants will not be able to overwhelm the "brother" element and its descendants.
For FF, the default z-index value of the element is auto. What does auto mean? It means "whatever, it's none of my business." Then the z-value level of the descendants will only be the same as their own z-index. -index is related.


Generally, if there is no setting, the following elements are higher level than the previous elements. Note that this is when no positioning and floating are set.

1. z-index The default under IE is: z-index:0; while the default under FF is: z-index:auto;


It is this difference under IE/FF that causes the z value under IE and FF to be different. Different performance.


2. Under normal circumstances: Brothers (same level) elements latter stand up, and the father and son are higher than the father.



3. For positioned elements, (whether IE or FF), the Z value comparison between non-sibling relationship and non-parent-child relationship elements needs to be traced back to the sibling relationship...
Thank you brother for finding so many! ! To put it simply, the z-index value of an element in a normal document stream is 0 under IE and auto under FF. It seems that the default value of positioned elements is not mentioned. And other brothers and sisters have nothing to do with the problem.

The default value of z-index for positioned elements is auto

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!