当前位置:网站首页>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
边栏推荐
- UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
- 怎样删除对象的某个属性或⽅法
- Qt学习25 布局管理器(四)
- NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
- [bw16 application] instructions for firmware burning of Anxin Ke bw16 module and development board update
- There is nothing new under the sun. Can the meta universe go higher?
- Comprehensive case of MySQL data addition, deletion, modification and query
- GoLand 2021.2 configure go (go1.17.6)
- Sequence table (implemented in C language)
- SQL Injection (GET/Search)
猜你喜欢
核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
Ocean CMS vulnerability - search php
Golang - command line tool Cobra
Mysql:insert date:SQL 错误 [1292] [22001]: Data truncation: Incorrect date value:
Vite project commissioning
SQL Injection (AJAX/JSON/jQuery)
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
Qt学习25 布局管理器(四)
[email "/>
Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
Flutter dynamic | fair 2.5.0 new version features
随机推荐
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
jvm-类加载
Halcon combined with C # to detect surface defects -- Halcon routine autobahn
【556. 下一个更大元素 III】
page owner特性浅析
Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
IBEM mathematical formula detection data set
QT learning 20 standard dialog box in QT (middle)
Function calling convention
Golang — 命令行工具cobra
[556. Next larger element III]
Stack application (balancer)
Implementation of Muduo asynchronous logging
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
记录关于银行回调post请求405 问题
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
JS continues to explore...
GoLand 2021.1: rename the go project
FPGA测试方法以Mentor工具为例