Skip to content
风禾源泉
Search
K
Main Navigation
Home
前端
面试题
跨端
框架
优化
其他
经验
成长
书籍
规律
反思
思维
我的工具
Pocket - JS常用方法
Tiny - Lottie 压缩
关于
博客
掘金
GitHub
Appearance
GitHub
Menu
Return to top
On this page
Table of Contents for current page
18.z-index
不使用 z-index 堆叠顺序
顺序规则:节点不设置 position, 后覆盖前
定位规则:设置 positon: relative absolute fixed, 会覆盖没有设置 position 元素,或者属性值为 static 节点,
参与规则:不设置 position 三个属性,直接设置属性 z-index, 是不生效的
默认规则:都设置了 position: realtive, z-index:0 和不设置 z-index 一样,靠后的在上
从父原则:父 A 里的 A1 子设置 z-index 在高,都不会覆 B 里面设置 z-index 低 的 B1
https://www.cnblogs.com/GeniusLyzh/p/4621335.html