当前位置:网站首页>Invalid Z-index problem
Invalid Z-index problem
2022-07-03 14:02:00 【pzy_ six hundred and sixty-six】
Scenario description
There is a pop-up component today , There is a pull-down component in the pop-up window , But after the pull-down component is pulled down , The extra part , Covered by the pop-up window assembly
z-index Several invalid situations and solutions
The parent element sets overflow:hidden|auto /display:none/
If the parent element has set overflow:hidden /display:none/ etc. , Then if the child element is absolutely positioned outside the parent element , Then adjust the sub elements z-index May not show .
.father {
display: none;
opacity: 0;
overflow: hidden; (auto)
position: relative;
}
.son {
position: absolute;
top: 0;
right: 0;
z-index: 100;
}
Solution
Cancel the above attributes of the parent element .
The parent element level is low
<div style="z-index: 1">
<div style="z-index: 10">son</div>
</div>
<div style="z-index: 2"></div>
The first parent DIV The hierarchy is 1, Second parent DIV The hierarchy is 2, Children within the first parent DIV yes 10. Due to the difference between parents , So internal children z-index The setting is very big , Will not be promoted to the upper level of the second parent , That's why z-index Invalid illusion .
Solution
View the parent element z-index And modify it
No positioning is set
Use z-index The premise is , Need to set up div Of location (eg: position: absolute;) If the element is a standard stream , No location , Then set z-index Does not make the current element above another element .
Solution
Set the positioning of the current element and parent element
Development reminder
Can be z-index Values are maintained in a single place , Avoid z-index Value chaos
Reference resources
边栏推荐
- Vite project commissioning
- QT learning 24 layout manager (III)
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
- RocksDB LRUCache
- RichView TRVStyle ListStyle 列表样式(项目符号编号)
- Go: send the get request and parse the return JSON (go1.16.4)
- Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
- Qt学习24 布局管理器(三)
- 怎样删除对象的某个属性或⽅法
猜你喜欢
[email"/>Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email

Ocean CMS vulnerability - search php

How to use lxml to judge whether the website announcement is updated

JVM class loading

Go language unit test 4: go language uses gomonkey to test functions or methods

QT learning 21 standard dialog box in QT (Part 2)

Bidirectional linked list (we only need to pay attention to insert and delete functions)

Qt学习24 布局管理器(三)

Installation impression notes

Summary of common error reporting problems and positioning methods of thrift
随机推荐
Leetcode-1175. Prime Arrangements
Qt学习22 布局管理器(一)
Unity embeddedbrowser browser plug-in event communication
There is nothing new under the sun. Can the meta universe go higher?
JS download files through URL links
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
Mysql:insert date:SQL 错误 [1292] [22001]: Data truncation: Incorrect date value:
Qt学习18 登录对话框实例分析
Logback log sorting
Dlopen() implements dynamic loading of third-party libraries
QT learning 19 standard dialog box in QT (top)
QT learning 25 layout manager (4)
Go language unit test 5: go language uses go sqlmock and Gorm to do database query mock
JS continues to explore...
Software testing is so hard to find, only outsourcing offers, should I go?
Selenium browser (1)
Static linked list (subscript of array instead of pointer)
Qt学习24 布局管理器(三)
MySQL data processing value addition, deletion and modification
Replace the GPU card number when pytorch loads the historical model, map_ Location settings