Typography · 23 of 33
Infinite Marquee
Continuous scrolling text loop
<div class="marquee-wrapper">
<div class="marquee-inner">
<span>SCROLLING TEXT LOOP • SCROLLING TEXT LOOP • </span><span aria-hidden="true">SCROLLING TEXT LOOP • SCROLLING TEXT LOOP • </span>
</div>
</div>
.marquee-wrapper {
overflow: hidden;
white-space: nowrap;
mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
-webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-inner {
display: inline-block;
animation: marquee 10s linear infinite;
}
.marquee-inner span {
padding-right: 2rem;
font-size: 3rem;
font-weight: 700;
color: #6b6b80;
}
/* The text is duplicated in the HTML, so -50% loops seamlessly */
@keyframes marquee {
from { transform: translateX(0); }
to { transform: translateX(-50%); }
}