<!-- Wrap the slider in div with overflow hidden to hide scrollbars -->
<div class="overflow-hidden">
<!-- The slider itself is a flex grid -->
<div class="flex -mx-4 img-ticker">
<!-- Original set of images -->
<!-- Each image is a grid column with width 16rem (w-64) and horiztonal margin 1rem (mx-4) -->
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=1">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=2">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=3">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=4">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=5">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=6">
<!-- Copy set of images -->
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=1">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=2">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=3">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=4">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x341/f4ccccff/434343?text=5">
<img class="w-64 mx-4 self-start flex-none" src="https://via.placeholder.com/256x192/f4ccccff/434343?text=6">
</div>
</div>
@keyframes ticker-kf {
0% {
transform: translate3d(0, 0, 0);
}
100% {
transform: translate3d(-108rem, 0, 0);
}
}
.img-ticker {
animation: ticker-kf 18s linear infinite;
}
This Pen doesn't use any external JavaScript resources.