【发布时间】:2019-12-14 11:27:03
【问题描述】:
我在::after 上使用linear-gradient 来制作这样的对象,即消失的边框。现在我想使用scale 使其中一个如此活跃(选中),但看起来它忽略了z-index: -1; 并显示所有渐变。我想像其他人一样显示选定的一个。
.Winter-Plans {
width: calc(100%/5 - 16px);
min-height: 360px;
position: relative;
border-radius: 20px;
background: white;
padding: 80px 15px 35px 15px;
margin: 0 8px 20px 8px;
box-sizing: border-box;
float: left;
}
.Winter-Plans::after {
position: absolute;
top: -1px;
bottom: -1px;
left: -1px;
right: -1px;
background: linear-gradient(to top, #ddd, white);
content: '';
z-index: -1;
border-radius: 20px;
}
.Winter-Plans.Selected {
transform: scale(1.1);
}
<div class="Winter-Plans">
</div>
<div class="Winter-Plans Selected">
</div>
<div class="Winter-Plans">
</div>
这个标题有很多话题,我试过了,但没有一个能解决我的问题。 ps:我无法更改html结构,为此我使用了::after
【问题讨论】:
标签: html css linear-gradients