当前位置:网站首页>[wechat applet] Z-index is invalid
[wechat applet] Z-index is invalid
2022-04-23 12:21:00 【Juvenile song line s】
First of all, the demand :
<view class="A"></view>
<view class="B">
<view class="C"></view>
</view>
I want hierarchy : C > A > B
Simple to z-index
You can't , You'll find that C
Of z-index
Always follow the parent element B
, Why? ? Let's take a closer look z-index
The rules of
z-index
Only inposition
byabsolute | fixed | relative | sticky
When it comes into effect .- When the parent element is set
z-index
after , Set by its child elementsz-index
Will be arranged within the parent element , In this case, the child element will not cross the rendering hierarchy with other elements outside the parent element .
The second is also called Stack context , This term is no longer explained here , Those interested can search by themselves . Let me just say my understanding :
Each is set z-index
The element of the attribute is a Parallel space , The child elements under this element can only be in The parallel space Make a hierarchical comparison , and Elements that cannot be parallel to other spaces Make a hierarchical comparison .
Say conclusion : In the HTML Under the layout , There is no solution to this problem .
Of course , The subject still found two solutions , All need to change HTML Layout :
<!-- The outermost layer is covered with a parent box , So everyone is in the same parallel universe -->
<view class=" Set box ">
<view class="A"></view>
<view class="B">
<view class="C"></view>
</view>
</view>
<!-- take C Take out the box , Use absolute positioning , Or adjust the code order to put it in the right place -->
<view class="A"></view>
<view class="C"></view>
<view class="B"></view>
such z-index
It will take effect !
版权声明
本文为[Juvenile song line s]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231215550149.html
边栏推荐
- 【Redis 系列】redis 学习十三,Redis 常问简单面试题
- ThinkPHP adds image text watermark to generate promotion poster with QR code
- Relu function of activation function
- Force buckle - 70 climb stairs
- How to expand the capacity of the server in the 100 million level traffic architecture? Well written!
- Introduction to metalama 4 Use fabric to manipulate items or namespaces
- The fourth chapter is to enable the filling object of IM and enable ADO for im column storage (IM 4.8)
- 硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
- 5-minute NLP: text to text transfer transformer (T5) unified text to text task model
- 软件测试对于减少程序BUG有多大帮助?
猜你喜欢
为什么要有包装类,顺便说一说基本数据类型、包装类、String类该如何转换?
Debug Jest test cases in VSCode, debug Jest test cases in VSCode, middle note basedir=$(dirname "$" (echo "$0" sed -e -e, s, \ \, / "-e").
传统企业如何应对数字化转型?这些书给你答案
The maximum number of remote desktop servers has been exceeded
Metalama简介4.使用Fabric操作项目或命名空间
1. Construction of electron development environment
欣旺达宣布电池产品涨价 此前获“蔚小理”投资超10亿
Fastjson 2 来了,性能继续提升,还能再战十年
On lambda powertools typescript
Basic software testing Day2 - Case Execution
随机推荐
QT double buffer drawing
消息队列概述
I changed to a programmer at the age of 31. Now I'm 34. Let me talk about my experience and some feelings
31岁才转行程序员,目前34了,我来说说我的经历和一些感受吧...
Pagoda panel command line help tutorial (including resetting password)
一个平面设计师的异想世界|ONES 人物
Idea code formatting plug-in save actions
uni-app 原生APP-本地打包集成极光推送(JG-JPUSH)详细教程
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
智能多线弹性云增加独立的IP地址,如何实现多线功能?
Sigmoid function of activation function
Lesson 24 analysis of classical problems
How the database fills in IM expressions (IM 5.4)
After a circle, I sorted out this set of interview questions..
PSCP basic usage
力扣-1137.第N个泰波那契数
IDEA 代码质量规范插件SonarLint
SynchronousQueue 源码解析
Win10 splash screen after startup
NativeForMySQL 连接MySQL8 提示:1251- Client does not support authentication protocol