1 回答

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超8個(gè)贊
更改 Z-Index 可以解決您的問(wèn)題,如果我理解正確的話,您的勾號(hào)將不會(huì)顯示(圖片覆蓋了它)。也許像這樣嘗試:
.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 */
}
′′′
添加回答
舉報(bào)