当前位置:网站首页>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
边栏推荐
- Halcon combined with C # to detect surface defects -- Halcon routine autobahn
- Static linked list (subscript of array instead of pointer)
- 挡不住了,国产芯片再度突进,部分环节已进到4nm
- Use vscode to view hex or UTF-8 codes
- Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS
- C language standard IO function sorting
- Qt学习23 布局管理器(二)
- 使用vscode查看Hex或UTF-8编码
- Another industry has been broken by Chinese chips. No wonder the leading analog chip companies in the United States have cut prices and sold off
- Function calling convention
猜你喜欢

There is nothing new under the sun. Can the meta universe go higher?

Qt学习20 Qt 中的标准对话框(中)

Halcon combined with C # to detect surface defects -- Halcon routine autobahn

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

QT learning 25 layout manager (4)

Qt学习19 Qt 中的标准对话框(上)
[email protected] (FE) | glycyrrhetinic acid modified metal organ"/>Formation of mil-100 (FE) coated small molecule aspirin [email protected] (FE) | glycyrrhetinic acid modified metal organ

jvm-运行时数据区
![[技术发展-24]:现有物联网通信技术特点](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[技术发展-24]:现有物联网通信技术特点

Installation impression notes
随机推荐
Leetcode-1175.Prime Arrangements
Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:
Go 1.16.4: manage third-party libraries with Mod
Mastering the cypress command line options is the basis for truly mastering cypress
使用vscode查看Hex或UTF-8编码
JS new challenges
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
Similarities and differences of sessionstorage, localstorage and cookies
Uniapp tips - scrolling components
UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
Qt学习19 Qt 中的标准对话框(上)
[développement technologique - 24]: caractéristiques des technologies de communication Internet des objets existantes
Go language unit test 4: go language uses gomonkey to test functions or methods
JVM runtime data area
怎样删除对象的某个属性或⽅法
QT learning 25 layout manager (4)
Replace the GPU card number when pytorch loads the historical model, map_ Location settings
可编程逻辑器件软件测试