当前位置:网站首页>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
边栏推荐
- 金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
- Summary of common error reporting problems and positioning methods of thrift
- selenium 浏览器(1)
- [技术发展-24]:现有物联网通信技术特点
- 又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
- windos 创建cordova 提示 因为在此系统上禁止运行脚本
- 记录关于银行回调post请求405 问题
- 使用vscode查看Hex或UTF-8编码
- GoLand 2021.1.1: configure the multi line display of the tab of the open file
- The small project (servlet+jsp+mysql+el+jstl) completes a servlet with login function, with the operation of adding, deleting, modifying and querying. Realize login authentication, prevent illegal log
猜你喜欢

JVM runtime data area

Go language web development series 30: gin: grouping by version for routing

Rasp implementation of PHP

QT learning 25 layout manager (4)
![[技术发展-24]:现有物联网通信技术特点](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[技术发展-24]:现有物联网通信技术特点

Using registered classes to realize specific type matching function template

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

QT learning 17 dialog box and its types

jvm-对象生命周期

又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
随机推荐
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
The small project (servlet+jsp+mysql+el+jstl) completes a servlet with login function, with the operation of adding, deleting, modifying and querying. Realize login authentication, prevent illegal log
Comprehensively develop the main channel of digital economy and digital group, and actively promote the utonmos digital Tibet market
怎样删除对象的某个属性或⽅法
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
PHP maze game
PhpMyAdmin stage file contains analysis traceability
Go language web development series 30: gin: grouping by version for routing
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
selenium 浏览器(1)
Depth and breadth first traversal of tree (regardless of binary tree)
IBEM mathematical formula detection data set
[acnoi2022] guess numbers
Qt学习17 对话框及其类型
Use docker to build sqli lab environment and upload labs environment, and the operation steps are provided with screenshots.
RocksDB LRUCache
[机缘参悟-37]:人感官系统的结构决定了人类是以自我为中心
消息订阅与发布
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
[combinatorics] permutation and combination (two counting principles, examples of set permutation | examples of set permutation and circle permutation)