<div class="marquee">
<span class="marquee__inner">Surface Book is the first of its kind. This innovative and perfectly crafted laptop is a creative powerhouse, designed to adapt to the way you work – with touch, a Pen, or a mouse.</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::before, .marquee::after {
z-index: 1;
top: 0; left: 0;
position: absolute;
width: 50px; height: 100%;
content: ""; display: block;
background: linear-gradient( to right, white, transparent );
}
.marquee::after {
left: auto; right: 0;
transform: rotate(180deg);
}
/* Pauses the animations when we hover the marquee */
.marquee:hover, .marquee:hover .marquee__inner {
/* Some browsers may require -webkit-animation-play-state */
animation-play-state: paused;
}
/* Some browsers may require @-webkit-keyframes */
@keyframes reduce {
to {
padding-left: 0;
}
}
@keyframes scroll {
to {
transform: translateX( -100% );
}
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!