我不能让CSS carousel中的一些图像链接工作。我认为大多数图像都阻塞了图像链接,因为当我将图像链接从底层图像的区域移开时,链接实际上是工作的。我在CSS代码中尝试了z-index,但不起作用。
/* colorDissolve */
.colorDissolve {
position: relative;
max-width: 95vh;
height: 76vh;
left: 50%;
transform: translateX(-50%);
}
.colorDissolve .item {
position: absolute;
text-align: center;
opacity: 0;
-webkit-animation: colorDissolve 21s linear infinite;
-moz-animation: colorDissolve 21s linear infinite;
-ms-animation: colorDissolve 21s linear infinite;
animation: colorDissolve 21s linear infinite;
}
.colorDissolve .item:nth-child(2) {
-webkit-animation-delay: 9s;
-moz-animation-delay: 9s;
-ms-animation-delay: 9s;
animation-delay: 9s;
}
.colorDissolve .item:nth-child(3) {
-webkit-animation-delay: 15s;
-moz-animation-delay: 15s;
-ms-animation-delay: 15s;
animation-delay: 15s;
}
.span1aa {
position: absolute;
margin: 0;
top: 25%;
left: 27%;
transform: translate(-50%, -50%);
}
/*image link not clicking*/
.span1aa a img {
width: 66%;
position: relative;
z-index: 2;
}
/*bottom? image*/
.item img {
z-index: 1;
}
.span1a {
position: absolute;
margin: 0;
top: 71%;
left: 27%;
transform: translate(-50%, -50%);
}
.span1a a img {
width: 62%;
}
.span1 {
position: absolute;
margin: 0;
top: 30%;
left: 72%;
transform: translate(-50%, -50%);
}
.span1 a img {
width: 95%;
}
@-webkit-keyframes colorDissolve {
0%,
25%,
100% {
opacity: 0;
}
4.17%,
20.84% {
opacity: 1;
}
}
@-moz-keyframes colorDissolve {
0%,
25%,
100% {
opacity: 0;
}
4.17%,
20.84% {
opacity: 1;
}
}
@-ms-keyframes colorDissolve {
0%,
25%,
100% {
opacity: 0;
}
4.17%,
20.84% {
opacity: 1;
}
}
@keyframes colorDissolve {
0%,
25%,
100% {
opacity: 0;
}
4.17%,
20.84% {
opacity: 1;
}
}
个字符
我这里有一个代码:https://codepen.io/emilysarah1/pen/GReoEzo
1条答案
按热度按时间nle07wnf1#
你有一个分层问题,你的图片“pexels-mohammad-danish-891059-1.jpg”与其他图片重叠,无法点击下面的图片。
简单地使图像透明并不能解决这个问题,因为图像即使在不可见的情况下也会保持在同一位置。
我建议添加JavaScript来动态添加/删除元素。或者,您可以在每个图像上放置一个元素,并在动画期间更新其链接。
(如果我的解释不清楚或没有帮助,我道歉。