JSFiddle - React, Tailwind, and code Playground
HTML
<div class="zd-container" id="zd-collection2">
<div class="zd-slider">
<img id="blank" src="http://via.placeholder.com/1440x133/f44242/ffffff" alt="" />
<img id="img_01" src="http://via.placeholder.com/1440x133/86f441/ffffff" alt="" />
<a href="http://www.google.com">
<img id="img_02" src="http://via.placeholder.com/1440x133/f44242/ffffff" alt="" />
</a>
<img id="img_03" src="http://via.placeholder.com/1440x133/41aff4/ffffff" alt="" />
</div>
</div>
CSS
.zd-slider {
position: relative;
overflow: hidden;
margin-top: 0px;
}
.zd-slider a {
display: block;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.zd-slider img[id*="img"] {
width: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
/* set the width/height of the slideshow */
.zd-slider img#blank {
display: block;
width: 100%;
visibility: hidden;
}
/* the slideshow */
.zd-slider #img_01 {
-webkit-animation: autoplay 9s linear infinite 0s;
animation: autoplay 9s linear infinite 0s;
}
.zd-slider #img_02 {
-webkit-animation: autoplay 9s linear infinite 3s;
animation: autoplay 9s linear infinite 3s;
}
.zd-slider #img_03 {
-webkit-animation: autoplay 9s linear infinite 6s;
animation: autoplay 9s linear infinite 6s;
}
@-webkit-keyframes autoplay {
4%,
33% {
z-index: 2;
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
0%,
37%,
100% {
z-index: 1;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
}
@keyframes autoplay {
4%,
33% {
z-index: 2;
opacity: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}
0%,
37%,
100% {
z-index: 1;
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
}
}
/* the slide timing indicator */
.zd-slider #slide {
width: 98px;
height: 5px;
position: absolute;
left: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.5);
-webkit-animation: slide 3s linear infinite;
animation: slide linear 3s infinite;
}
@keyframes slide {
0% {
left: -100px;
}
100% {
left: 100%;
}
}
@-webkit-keyframes slide {
0% {
left: -100px;
}
100% {
left: 100%;
}
}