1 回答
TA贡献1799条经验 获得超8个赞
更改 Z-Index 可以解决您的问题,如果我理解正确的话,您的勾号将不会显示(图片覆盖了它)。也许像这样尝试:
.caption {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
padding: 0 10px;
pointer-events: none;
}
.gallery img {
display: block;
z-index: 1; /* Make sure its lower then the tick one */
}
.gallery input {
display: none;
}
.gallery input:checked + .caption {
background: rgba(0,0,0,0.5);
}
.gallery input:checked + .caption::after {
content: '✔';
position: absolute;
top: 50%; left: 50%;
width: 70px; height: 70px;
transform: translate(-50%,-50%);
color: green;
font-size: 36px;
line-height: 27px;
text-align: center;
z-index: 500; /* Just some high value */
}
´´´
添加回答
举报