CSS-Only Marquee: Animating Text Without JavaScript

Building a marquee effect is straightforward when you rely on a negative translate animation to shift text that’s intentionally wider than the viewport. The catch is duplicating the content for a seamless loop—that usually means copying the text, which hurts accessibility.

One workaround is marking every duplicate with aria-hidden, leaving a single readable instance. Another, more elegant approach uses text-shadow to fake the repetition so the DOM stays clean. The trick respects prefers-reduced-motion as well, disabling the scroll for users who need it.