JSFiddle - React, Tailwind, and code Playground
HTML
<div class="marquee">
<span class="marquee__inner">ITG LIVE with Professor Brian Cox OBE, Mary Portas and Randi Zuckerbert. Click here to discover more.</span>
</div>
CSS
/* Sets up our marquee, and inner content */
.marquee {
overflow: hidden;
position: relative;
padding-left: 100%;
/* Some browsers may require -webkit-animation */
animation: reduce 20s linear infinite;
}
.marquee__inner {
white-space: nowrap;
display: inline-block;
/* Some browsers may require -webkit-animation */
animation: scroll 20s linear infinite;
}
/* Creates two white-to-transparent gradients at the ends of the marquee */
.marquee:hover, .marquee__inner:hover
{
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
animation-play-state: paused;
}
.marquee::before, .marquee::after {
z-index: 1;
top: 0; left: 0;
position: absolute;
width: 50px; height: 100%;
content: ""; display: block;
}
.marquee::after {
left: auto; right: 0;
transform: rotate(180deg);
}
@keyframes reduce {
to {
padding-left: 0;
}
}
@keyframes scroll {
to {
transform: translateX( -100% );
}
}