我有一页,这页被一分为二.页面的一部分是child1,另一部分是child2.
等级制度
Parent
Child1
Child2
下面是页面中包含的css
Child1 -> z-index: 1
Child2 -> z-index: 2
我想在点击child1中的按钮时为整个页面提供背景.Css如下
.backdrop {
position: fixed;
background-color: rgba(16,19,22,.6);
z-index: 5;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
但这只涉及child1组件.我希望它能覆盖整页.