position为fixed时设置z-index失效:
https://blog.csdn.net/acingdreamer/article/details/78561408
不受控制的 position:fixed:
https://www.cnblogs.com/coco1s/p/7358830.html
- z-index只有在设置了position为relative,absolute,fixed时才会有效。
- z-index的“从父原则”。当你发现把z-index设的多大都没用时,看看其父元素是否设置了有效的z-index,当然别忘了先看看自身是否设置了position。
网友评论