CSS z-index 屬性的使用方法和層級樹的概念

http://www.neoease.com/css-z-index-property-and-layering-tree/css

總結:瀏覽器

1.若是節點沒有position 屬性,或position 屬爲static,位於文檔流後面的節點會覆蓋前面的節點,且z-index屬性無效。spa

2.position 屬性爲relative 、absolute 或fixed 的節點會覆蓋沒有設position 屬性,或position 屬爲 static 的節點。ci

3.若是節點定義了position 屬性(即relative 、absolute 或fixed ,如下同),則層級關係以z-index的值爲準。z-index的值能夠爲負值。文檔

4.若是節點定義了position 屬性,其子節點的層級關係以父節點爲準。get

5.IE8 以上和 W3C 瀏覽器 z-index 默認值是 auto, IE6 IE7 0。it

相關文章
相關標籤/搜索