CSS Marquees: Infinite Scrolling Text and Logo Strips
Updated 2026-10-16. 10 effects.
A CSS marquee loops a row of text or logos sideways without a gap. Put the items in a track twice, animate the track with translateX from 0 to minus 50 percent, and the copy takes over exactly where the first ends. Hide the duplicate from screen readers and pause the loop on hover, focus and reduced motion.
The old marquee element is obsolete, so these use a plain list and a keyframe. Text marquees work as section dividers and announcement strips; logo strips show who a business works with; slower rows of quotes or photos suit testimonials and galleries. Keep the speed gentle enough that a word can be read in passing.
A moving row must never be the only place important information lives. If a strip lists services or opening times, put the same facts in normal text nearby. Each piece here has a visible pause button where the row carries real content, which is also what WCAG asks for when movement lasts longer than five seconds.
Compare them
| Effect | Built with | Size (gzipped) | Running cost | Browser support |
|---|---|---|---|---|
| Announcement Bar Marquee With Linked Notices | CSS only | 2 KB | A slim strip moved by one transform on the compositor, held still once it leaves the screen. | All current browsers |
| List Rows That Turn Into Marquee Bands On Hover | CSS only | 2 KB | Each band only runs its loop while its row is lit; the rest sit paused, and the idle demo is a slow class swap. | All current browsers |
| Logo Strip Marquee With Soft Edge Fade | CSS only | 1.9 KB | One transform keyframe on one track, paused by an observer whenever the strip leaves the screen. | All current browsers |
| Opening Hours Ticker With Full Timetable | CSS only | 2.1 KB | One monospace text strip loops on a transform and stops through an observer when scrolled away. | All current browsers |
| Outlined Word Marquee Rows In Opposite Directions | CSS only | 1.6 KB | Two compositor transforms on two tracks; both freeze through animation-play-state when off screen. | All current browsers |
| Photo Strip Marquee With Captioned Frames | CSS only | 1.9 KB | Five photos loaded up front with fixed aspect boxes; the belt is one transform, halted off screen. | All current browsers |
| Pill Button With Looping Marquee Label | CSS only | 1.9 KB | The tiny label loop only runs while the button is lit; at rest nothing animates. | All current browsers |
| Review Card Marquee With Pause Button | CSS only | 2.1 KB | A single slow transform loop over six cards; the browser composites it and the observer halts it out of view. | All current browsers |
| Scroll Velocity Marquee That Speeds And Reverses | CSS and a small script | 2.5 KB | Scrolling only changes the playback rate of existing CSS animations, and the short frame loop ends once the speed settles. | All current browsers |
| Tilted Crossing Marquee Bands For Event Dates | CSS only | 1.7 KB | Two rotated strips each move one inner transform; nothing repaints beyond the compositor. | All current browsers |
Announcement Bar Marquee With Linked Notices
A dark top bar above a boot maker's shop header runs four short notices, and each one is a real underlined link to a page on the site. Tabbing into a link stops the bar so the focus ring never slides away, and the copy used for the seamless loop is skipped by Tab. A square icon button at the end pauses it for good. Fits any shop or booking site header.
<section class="w3ann">
<div class="w3ann-bar">
<div class="w3ann-view">
<div class="w3ann-track">
<ul class="w3ann-group">
<li><a href="#">Resoling for winter: book a slot before 30 November</a></li>
<li><a href="#">Read how a resole is done at our bench</a></li>
<li><a href="#">New in: the waxed canvas field tote</a></li>
<li><a href="#">Workshop open Tuesday to Saturday, 10 to 6</a></li>
</ul>
</div>
</div>
<button class="w3ann-toggle" type="button" aria-pressed="false" aria-label="Pause announcements">
<svg viewBox="0 0 16 16" aria-hidden="true"><path class="w3ann-icon" d="M4 2.5h3v11H4zM9 2.5h3v11H9z"/></svg>
</button>
</div>
<header class="w3ann-head">
<a class="w3ann-logo" href="#">Fenwick Boot Co.</a>
<nav aria-label="Main"><ul class="w3ann-nav"><li><a href="#">Boots</a></li><li><a href="#">Repairs</a></li><li><a href="#">Care</a></li><li><a href="#">Our bench</a></li></ul></nav>
<a class="w3ann-cart" href="#">Basket (0)</a>
</header>
<div class="w3ann-hero">
<h1>Goodyear welted boots, stitched and resoled in one workshop.</h1>
<p>Leather from two tanneries we visit each spring, cut and lasted by hand, and resoled at the same bench when the soles wear through.</p>
</div>
</section>
<style>
/* Change these: loop time, bar colour, page colour, focus accent. */
.w3ann { --w3ann-speed: 40s; --w3ann-ink: #1d1b18; --w3ann-paper: #f4f1ea; --w3ann-focus: #e3b45a; }
.w3ann { background: var(--w3ann-paper); color: var(--w3ann-ink); font-family: ui-sans-serif, system-ui, sans-serif; }
.w3ann a:focus-visible, .w3ann button:focus-visible { outline: 2px solid var(--w3ann-focus); outline-offset: 2px; border-radius: 3px; }
.w3ann-bar { display: flex; align-items: center; background: var(--w3ann-ink); color: var(--w3ann-paper); }
.w3ann-view { flex: 1; overflow: hidden; }
.w3ann-track { display: flex; width: max-content; animation: w3ann-run var(--w3ann-speed) linear infinite; }
.w3ann-group { display: flex; align-items: center; gap: 40px; padding: 0 40px 0 0; margin: 0; list-style: none; height: 44px; white-space: nowrap; font-size: 14px; }
.w3ann-group li { display: flex; align-items: center; gap: 40px; }
.w3ann-group li::after { content: "/"; color: #8e8a80; }
.w3ann-group a { color: inherit; text-decoration: underline; text-decoration-color: #8e8a80; text-underline-offset: 4px; }
.w3ann-group a:hover { text-decoration-color: var(--w3ann-paper); }
.w3ann[data-paused] .w3ann-track, .w3ann[data-off] .w3ann-track, .w3ann-view:hover .w3ann-track, .w3ann-view:focus-within .w3ann-track { animation-play-state: paused; }
@keyframes w3ann-run { to { transform: translateX(-50%); } }
.w3ann-toggle { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-left: 1px solid #3a3732; background: transparent; color: inherit; cursor: pointer; }
.w3ann-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.w3ann-toggle:hover { background: #2c2925; }
.w3ann-head { max-width: 72rem; margin: 0 auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 0 #ddd6c8; }
.w3ann-logo { color: inherit; text-decoration: none; font: 600 20px ui-serif, Georgia, serif; letter-spacing: -.01em; }
.w3ann-nav { display: none; gap: 32px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 500; }
.w3ann-nav a { color: #3d3a34; text-decoration: none; }
@media (min-width: 640px) { .w3ann-nav { display: flex; } }
.w3ann-cart { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--w3ann-ink); color: var(--w3ann-paper); font-size: 14px; font-weight: 500; text-decoration: none; }
.w3ann-hero { max-width: 72rem; margin: 0 auto; padding: 64px 20px; display: grid; gap: 32px; align-items: end; }
@media (min-width: 768px) { .w3ann-hero { grid-template-columns: 1fr 1fr; padding: 80px 20px; } }
.w3ann-hero h1 { margin: 0; font: 600 clamp(36px, 5vw, 48px)/1.1 ui-serif, Georgia, serif; letter-spacing: -.02em; }
.w3ann-hero p { margin: 0; max-width: 28rem; font-size: 16px; line-height: 1.65; color: #4a463e; }
@media (prefers-reduced-motion: reduce) {
.w3ann-view { overflow-x: auto; }
.w3ann-track { animation: none; padding-left: 20px; }
.w3ann-group + .w3ann-group, .w3ann-toggle { display: none; }
}
</style>
<script>
(function () {
var root = document.querySelector(".w3ann");
if (!root) return;
var track = root.querySelector(".w3ann-track"), btn = root.querySelector(".w3ann-toggle"), icon = root.querySelector(".w3ann-icon");
/* the copy is hidden from screen readers and its links skipped by Tab */
var copy = track.firstElementChild.cloneNode(true);
copy.setAttribute("aria-hidden", "true");
copy.querySelectorAll("a").forEach(function (a) { a.tabIndex = -1; });
track.appendChild(copy);
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.setAttribute("aria-label", on ? "Play announcements" : "Pause announcements");
icon.setAttribute("d", on ? "M4 2.5v11l9-5.5z" : "M4 2.5h3v11H4zM9 2.5h3v11H9z");
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: The notices stand still in one line that can be scrolled sideways, and the pause button is hidden.
Running cost: A slim strip moved by one transform on the compositor, held still once it leaves the screen.
- Edit `notices` with your own label and link for each message; four or five short ones read best.
- Change `--w3ann-speed` for the pace and `--w3ann-ink` for the bar colour.
- Set `--w3ann-focus` to a colour that stands out against your bar for the focus ring.
List Rows That Turn Into Marquee Bands On Hover
A list of exhibitions at a harbour gallery reads as plain rows of title, subject and dates. Point at a row or tab to it and a slate blue band slides up from under the line and starts looping that show's title and dates. Until someone arrives the rows light one after another. Use it for event lists, project indexes or menus of services.
<section class="w3row">
<div class="w3row-inner">
<div class="w3row-head">
<h2>On at the Quayside Gallery</h2>
<p>Open Tuesday to Sunday, entry free</p>
</div>
<ul class="w3row-list">
<li><a class="w3row-link" href="#"><span class="w3row-text"><b>Salt and Silver</b><span>Early coastal photographs</span><small>Until 9 Nov</small></span></a></li>
<li><a class="w3row-link" href="#"><span class="w3row-text"><b>The Weaving Room</b><span>Looms, samples and pattern books</span><small>14 Nov to 2 Feb</small></span></a></li>
<li><a class="w3row-link" href="#"><span class="w3row-text"><b>Field Notes</b><span>Drawings from three botanists</span><small>From 6 Dec</small></span></a></li>
<li><a class="w3row-link" href="#"><span class="w3row-text"><b>Glass Harbour</b><span>Blown and cast glass</span><small>Spring</small></span></a></li>
</ul>
</div>
</section>
<style>
/* Change these: loop time inside a band, band colour, page colour, focus colour. */
.w3row { --w3row-speed: 9s; --w3row-band: #2d4a6b; --w3row-paper: #f7f6f2; --w3row-focus: #c2703d; }
.w3row { background: var(--w3row-paper); color: #1e2a36; padding: 72px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3row-inner { max-width: 64rem; margin: 0 auto; }
.w3row-head { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: flex-end; }
.w3row-head h2 { margin: 0; font-size: clamp(28px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; }
.w3row-head p { margin: 0; font-size: 14px; color: #4b5a69; }
.w3row-list { margin: 40px 0 0; padding: 0; list-style: none; border-top: 1px solid #cfd3d6; }
.w3row-list li { border-bottom: 1px solid #cfd3d6; }
.w3row-link { position: relative; display: block; overflow: hidden; color: inherit; text-decoration: none; }
.w3row-link:focus-visible { outline: 3px solid var(--w3row-focus); outline-offset: 2px; }
.w3row-text { display: grid; gap: 4px; padding: 24px 4px; }
@media (min-width: 640px) { .w3row-text { grid-template-columns: 1.3fr 1fr auto; gap: 24px; align-items: baseline; } }
.w3row-text b { font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em; }
.w3row-text span { font-size: 15px; color: #4b5a69; }
.w3row-text small { font: 14px ui-monospace, Menlo, monospace; color: #4b5a69; }
.w3row-band { position: absolute; inset: 0; display: flex; align-items: center; overflow: hidden; background: var(--w3row-band); color: var(--w3row-paper); transform: translateY(101%); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.w3row-track { display: flex; width: max-content; animation: w3row-run var(--w3row-speed) linear infinite; animation-play-state: paused; }
.w3row-group { display: flex; align-items: center; white-space: nowrap; font-size: clamp(26px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; }
.w3row-group i { font-style: normal; font-weight: 400; font-size: .5em; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin: 0 32px; }
.w3row-on .w3row-band, .w3row-link:focus-visible .w3row-band { transform: none; }
.w3row-on .w3row-track, .w3row-link:focus-visible .w3row-track { animation-play-state: running; }
@media (hover: hover) { .w3row-link:hover .w3row-band { transform: none; } .w3row-link:hover .w3row-track { animation-play-state: running; } }
@keyframes w3row-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .w3row-band { transition: none; } .w3row-track { animation: none; padding-left: 20px; } }
</style>
<script>
(function () {
/* Change this: how long each row stays lit in the idle demo (ms). */
var IDLE_STEP = 2200;
var root = document.querySelector(".w3row");
if (!root) return;
var links = root.querySelectorAll(".w3row-link");
/* build each decorative band from the row's own title and dates */
links.forEach(function (a) {
var band = document.createElement("span"), track = document.createElement("span"), group = document.createElement("span");
band.className = "w3row-band"; band.setAttribute("aria-hidden", "true");
track.className = "w3row-track"; group.className = "w3row-group";
for (var n = 0; n < 3; n++) {
group.appendChild(document.createTextNode(a.querySelector("b").textContent));
var d = document.createElement("i"); d.textContent = a.querySelector("small").textContent; group.appendChild(d);
}
track.appendChild(group); track.appendChild(group.cloneNode(true));
band.appendChild(track); a.appendChild(band);
});
if (matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var i = 0, timer = 0;
function light() { links.forEach(function (a, k) { a.classList.toggle("w3row-on", k === i); }); i = (i + 1) % links.length; }
function stop() { clearInterval(timer); timer = -1; links.forEach(function (a) { a.classList.remove("w3row-on"); }); }
/* idle demo runs only while visible and until a real pointer or focus arrives */
var io = new IntersectionObserver(function (e) {
if (timer < 0) return;
clearInterval(timer);
if (e[0].isIntersecting) { light(); timer = setInterval(light, IDLE_STEP); }
});
io.observe(root);
function hand() { stop(); io.disconnect(); }
root.addEventListener("pointerenter", hand, { once: true });
root.addEventListener("focusin", hand, { once: true });
})();
</script>
With reduced motion: A lit row simply turns slate blue with its title and dates shown still, with no slide or loop.
Running cost: Each band only runs its loop while its row is lit; the rest sit paused, and the idle demo is a slow class swap.
- Change `--w3row-band` for the band colour and `--w3row-speed` for how fast its words travel.
- Raise `IDLE_STEP` to hold each row longer during the idle demo.
- Edit `shows` (or the list items in HTML); the band text is built from each title and date.
Logo Strip Marquee With Soft Edge Fade
A quiet row of client wordmarks for a coastal accounting practice drifts left on white, and the ends dissolve into the page through a static mask so no name is ever cut by a hard edge. Each mark is a small inline SVG next to a name in its own type style. It suits the band just under a hero where a firm lists who it serves.
<section class="w3lgo">
<div class="w3lgo-inner">
<p class="w3lgo-kicker">Harbourline Accounts</p>
<h2 class="w3lgo-title">The books behind workshops, clinics and family firms along the coast</h2>
<div class="w3lgo-view">
<div class="w3lgo-track">
<ul class="w3lgo-group">
<li><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="4"/></svg><span class="w3lgo-serif">Northwell Joinery</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/></svg><span class="w3lgo-bold">Kettle Point</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 4h4v16H4zM10 8h4v12h-4zM16 12h4v8h-4z"/></svg><span class="w3lgo-caps">ASHBY & ROWE</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="7.5" fill="none" stroke="currentColor" stroke-width="3"/></svg><span>Lumen Dental</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 19C5 10 11 4 20 4c0 9-6 15-15 15z"/></svg><span class="w3lgo-serif w3lgo-it">Fernhill Co-op</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3l9.5 17h-19z"/></svg><span class="w3lgo-mono">CALDER FREIGHT</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/></svg><span class="w3lgo-serif w3lgo-bold">Oak and Ember</span></li>
<li><svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="4"/></svg><span class="w3lgo-bold">Marlow Clinic</span></li>
</ul>
</div>
</div>
<button class="w3lgo-toggle" type="button" aria-pressed="false">Pause logos</button>
</div>
</section>
<style>
/* Change these: loop time, gap between logos, logo colour, fade width at each edge. */
.w3lgo { --w3lgo-speed: 36s; --w3lgo-gap: 56px; --w3lgo-ink: #334155; --w3lgo-fade: 14%; }
.w3lgo { background: #fff; padding: 88px 20px; font-family: ui-sans-serif, system-ui, sans-serif; color: #0f172a; }
.w3lgo-inner { max-width: 64rem; margin: 0 auto; text-align: center; }
.w3lgo-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #64748b; }
.w3lgo-title { margin: 12px auto 0; max-width: 42rem; font-size: clamp(24px, 3.4vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.w3lgo-view { margin-top: 48px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--w3lgo-fade), #000 calc(100% - var(--w3lgo-fade)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--w3lgo-fade), #000 calc(100% - var(--w3lgo-fade)), transparent); }
.w3lgo-track { display: flex; width: max-content; animation: w3lgo-run var(--w3lgo-speed) linear infinite; }
.w3lgo-group { display: flex; gap: var(--w3lgo-gap); padding: 0 var(--w3lgo-gap) 0 0; margin: 0; list-style: none; }
.w3lgo-group li { display: flex; align-items: center; gap: 10px; height: 64px; white-space: nowrap; color: var(--w3lgo-ink); font-size: 18px; font-weight: 500; }
.w3lgo-group svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; color: #475569; }
.w3lgo-serif { font-family: ui-serif, Georgia, serif; letter-spacing: -.01em; }
.w3lgo-it { font-style: italic; }
.w3lgo-bold { font-weight: 600; letter-spacing: -.01em; }
.w3lgo-caps { font-weight: 700; letter-spacing: .18em; font-size: 15px; }
.w3lgo-mono { font-family: ui-monospace, Menlo, monospace; font-weight: 600; letter-spacing: .05em; font-size: 15px; }
.w3lgo[data-paused] .w3lgo-track, .w3lgo[data-off] .w3lgo-track, .w3lgo-view:hover .w3lgo-track, .w3lgo-view:focus-within .w3lgo-track { animation-play-state: paused; }
@keyframes w3lgo-run { to { transform: translateX(-50%); } }
.w3lgo-toggle { margin-top: 40px; height: 40px; padding: 0 18px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #334155; font: 500 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3lgo-toggle:hover { background: #f8fafc; }
.w3lgo-toggle:focus-visible { outline: 2px solid #0f172a; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
.w3lgo-view { -webkit-mask-image: none; mask-image: none; }
.w3lgo-track { animation: none; width: auto; justify-content: center; }
.w3lgo-group { flex-wrap: wrap; justify-content: center; column-gap: 40px; row-gap: 4px; padding: 0; }
.w3lgo-group[aria-hidden] { display: none; }
.w3lgo-toggle { display: none; }
}
</style>
<script>
(function () {
var root = document.querySelector(".w3lgo");
if (!root) return;
var track = root.querySelector(".w3lgo-track"), btn = root.querySelector(".w3lgo-toggle");
/* second copy makes the loop seamless; screen readers skip it */
var copy = track.firstElementChild.cloneNode(true);
copy.setAttribute("aria-hidden", "true");
track.appendChild(copy);
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play logos" : "Pause logos";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: The row stops and the client names wrap onto centred lines with no fade at the edges.
Running cost: One transform keyframe on one track, paused by an observer whenever the strip leaves the screen.
- Change `--w3lgo-speed` (or `SPEED` in React) to slow the loop; a longer time reads calmer.
- Widen `--w3lgo-fade` from 14% to soften the edges further on wide screens.
- Swap the entries in `clients` for your own names and pick a mark per row from square, circle, ring, tri, bars or leaf.
Opening Hours Ticker With Full Timetable
A thin navy bar runs the week's hours for a harbour coffee shop in gold and pale blue monospace, while a proper timetable card sits right below it with every day as a definition list. The ticker is built from that list, so the two can never disagree. A square button at the right end stops the bar. Good for cafes, shops and clinics whose hours change through the week.
<section class="w3hrs">
<div class="w3hrs-bar">
<p class="w3hrs-label"><span aria-hidden="true"></span>This week</p>
<!-- The ticker repeats the timetable below, so it is hidden from screen readers. -->
<div class="w3hrs-view" aria-hidden="true"><div class="w3hrs-track"><span class="w3hrs-group"></span></div></div>
<button class="w3hrs-toggle" type="button" aria-pressed="false" aria-label="Pause the hours ticker">
<svg viewBox="0 0 16 16" aria-hidden="true"><path class="w3hrs-icon" d="M4 2.5h3v11H4zM9 2.5h3v11H9z"/></svg>
</button>
</div>
<div class="w3hrs-body">
<div>
<p class="w3hrs-kicker">Pier Lane Coffee</p>
<h2>Late on Thursdays and Fridays, with soup and bread until close.</h2>
<p class="w3hrs-copy">Find us at 14 Pier Lane, two doors from the ferry ticket office. Dogs and prams are welcome inside.</p>
</div>
<div class="w3hrs-card">
<h3>Opening hours</h3>
<dl class="w3hrs-list">
<div><dt>Monday</dt><dd>7:00 to 15:00</dd></div>
<div><dt>Tuesday</dt><dd>7:00 to 15:00</dd></div>
<div><dt>Wednesday</dt><dd>7:00 to 15:00</dd></div>
<div><dt>Thursday</dt><dd>7:00 to 21:00</dd></div>
<div><dt>Friday</dt><dd>7:00 to 21:00</dd></div>
<div><dt>Saturday</dt><dd>8:00 to 16:00</dd></div>
<div><dt>Sunday</dt><dd>Closed</dd></div>
</dl>
</div>
</div>
</section>
<style>
/* Change these: loop time, navy background, gold accent, ticker height. Edit hours only in the list: the ticker copies it. */
.w3hrs { --w3hrs-speed: 34s; --w3hrs-bg: #0f1b2d; --w3hrs-gold: #f2c879; --w3hrs-h: 52px; }
.w3hrs { background: var(--w3hrs-bg); color: #e8edf5; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3hrs-bar { display: flex; align-items: center; border-bottom: 1px solid #22334d; background: #0a1422; }
.w3hrs-label { display: none; align-items: center; gap: 8px; margin: 0; padding: 0 20px; height: var(--w3hrs-h); border-right: 1px solid #22334d; font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--w3hrs-gold); white-space: nowrap; }
.w3hrs-label span { width: 8px; height: 8px; border-radius: 50%; background: #7fd1a4; }
@media (min-width: 640px) { .w3hrs-label { display: flex; } }
.w3hrs-view { flex: 1; overflow: hidden; }
.w3hrs-track { display: flex; width: max-content; animation: w3hrs-run var(--w3hrs-speed) linear infinite; }
.w3hrs-group { display: flex; align-items: center; gap: 28px; padding-right: 28px; height: var(--w3hrs-h); white-space: nowrap; font: 14px ui-monospace, Menlo, monospace; }
.w3hrs-group b { color: var(--w3hrs-gold); margin-right: 12px; }
.w3hrs-group i { font-style: normal; }
.w3hrs-group i::after { content: ""; display: inline-block; width: 4px; height: 4px; margin-left: 28px; vertical-align: middle; border-radius: 50%; background: #5b6f8c; }
.w3hrs[data-paused] .w3hrs-track, .w3hrs[data-off] .w3hrs-track, .w3hrs-bar:hover .w3hrs-track { animation-play-state: paused; }
@keyframes w3hrs-run { to { transform: translateX(-50%); } }
.w3hrs-toggle { display: grid; place-items: center; width: var(--w3hrs-h); height: var(--w3hrs-h); flex-shrink: 0; border: 0; border-left: 1px solid #22334d; background: transparent; color: #e8edf5; cursor: pointer; }
.w3hrs-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.w3hrs-toggle:hover { background: #15243a; }
.w3hrs-toggle:focus-visible { outline: 2px solid var(--w3hrs-gold); outline-offset: -2px; }
.w3hrs-body { max-width: 64rem; margin: 0 auto; padding: 64px 20px; display: grid; gap: 40px; }
@media (min-width: 768px) { .w3hrs-body { grid-template-columns: 1.1fr 1fr; gap: 64px; padding: 80px 20px; } }
.w3hrs-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--w3hrs-gold); }
.w3hrs-body h2 { margin: 16px 0 0; font-size: clamp(28px, 4vw, 36px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.w3hrs-copy { margin: 20px 0 0; max-width: 28rem; font-size: 16px; line-height: 1.65; color: #b8c4d6; }
.w3hrs-card { border: 1px solid #22334d; border-radius: 16px; background: #132239; padding: 24px; }
.w3hrs-card h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: #9fb0c8; }
.w3hrs-list { margin: 16px 0 0; }
.w3hrs-list div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #22334d; font-size: 15px; }
.w3hrs-list div:first-child { border-top: 0; }
.w3hrs-list dd { margin: 0; font-family: ui-monospace, Menlo, monospace; }
@media (prefers-reduced-motion: reduce) { .w3hrs-bar { display: none; } }
</style>
<script>
(function () {
var root = document.querySelector(".w3hrs");
if (!root) return;
var track = root.querySelector(".w3hrs-track"), group = track.firstElementChild, btn = root.querySelector(".w3hrs-toggle"), icon = root.querySelector(".w3hrs-icon");
/* build the ticker from the timetable so the two never disagree */
root.querySelectorAll(".w3hrs-list div").forEach(function (row) {
var item = document.createElement("i"), d = document.createElement("b");
d.textContent = row.querySelector("dt").textContent.slice(0, 3);
item.appendChild(d);
item.appendChild(document.createTextNode(row.querySelector("dd").textContent));
group.appendChild(item);
});
track.appendChild(group.cloneNode(true));
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.setAttribute("aria-label", on ? "Play the hours ticker" : "Pause the hours ticker");
icon.setAttribute("d", on ? "M4 2.5v11l9-5.5z" : "M4 2.5h3v11H4zM9 2.5h3v11H9z");
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: The moving bar is removed and the timetable card below carries every day and time on its own.
Running cost: One monospace text strip loops on a transform and stops through an observer when scrolled away.
- Edit the `hours` array in React or the rows of `.w3hrs-list` in HTML; the strip rebuilds from them.
- Change `--w3hrs-speed` for the loop time and `--w3hrs-h` for the bar height.
- Swap `--w3hrs-gold` for your accent colour on the day names and labels.
Outlined Word Marquee Rows In Opposite Directions
Two bands of oversized serif words cross a warm paper section in opposite directions, alternating solid and hollow stroked lettering with rust dots between them. The bands are pure decoration: the same bread names sit in a normal sentence above. Use it as a loud divider between calmer sections on a food, craft or studio site.
<section class="w3wrd">
<div class="w3wrd-head">
<h2>Hollis Street Bakery</h2>
<p>Country sourdough, seeded rye, spelt and morning buns, from a wood oven lit at four.</p>
</div>
<!-- The rows repeat the line above, so the whole moving block is hidden from screen readers. -->
<div class="w3wrd-view" aria-hidden="true">
<div class="w3wrd-track">
<span class="w3wrd-group"><b>Country sourdough</b><i>Seeded rye</i><b>Morning buns</b><i>Spelt loaf</i></span>
</div>
<div class="w3wrd-track w3wrd-r">
<span class="w3wrd-group"><b>Baked before six</b><i>Milled nearby</i><b>Long ferment</b><i>Wood fired</i></span>
</div>
</div>
<div class="w3wrd-foot"><button class="w3wrd-toggle" type="button" aria-pressed="false">Pause the words</button></div>
</section>
<style>
/* Change these: loop time, paper colour, ink colour, dot colour, word size. */
.w3wrd { --w3wrd-speed: 42s; --w3wrd-paper: #f3ece0; --w3wrd-ink: #2b2118; --w3wrd-dot: #b5562f; --w3wrd-size: clamp(44px, 8vw, 104px); }
.w3wrd { overflow: hidden; background: var(--w3wrd-paper); color: var(--w3wrd-ink); padding: 72px 0; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3wrd-head, .w3wrd-foot { max-width: 72rem; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: flex-end; }
.w3wrd-head h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #7a4a2c; }
.w3wrd-head p { margin: 0; max-width: 24rem; font-size: 16px; line-height: 1.6; color: #4a3b2e; }
.w3wrd-view { margin-top: 48px; overflow: hidden; }
.w3wrd-track { display: flex; width: max-content; animation: w3wrd-run var(--w3wrd-speed) linear infinite; }
.w3wrd-r { animation-direction: reverse; animation-duration: calc(var(--w3wrd-speed) * 1.25); }
.w3wrd-group { display: flex; align-items: center; white-space: nowrap; font-family: ui-serif, Georgia, serif; font-size: var(--w3wrd-size); line-height: 1.1; letter-spacing: -.03em; }
.w3wrd-group b, .w3wrd-group i { font-weight: 400; display: flex; align-items: center; }
.w3wrd-group i { color: transparent; -webkit-text-stroke: 1.5px var(--w3wrd-ink); }
.w3wrd-group b::after, .w3wrd-group i::after { content: ""; width: 12px; height: 12px; margin: 0 clamp(26px, 3vw, 42px); border-radius: 50%; background: var(--w3wrd-dot); }
.w3wrd[data-paused] .w3wrd-track, .w3wrd[data-off] .w3wrd-track, .w3wrd-view:hover .w3wrd-track { animation-play-state: paused; }
@keyframes w3wrd-run { to { transform: translateX(-50%); } }
.w3wrd-foot { margin-top: 40px; }
.w3wrd-toggle { height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--w3wrd-ink); color: var(--w3wrd-paper); font: 500 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3wrd-toggle:focus-visible { outline: 2px solid var(--w3wrd-ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
.w3wrd-track { animation: none; width: auto; padding: 0 20px; }
.w3wrd-group { flex-wrap: wrap; white-space: normal; font-size: clamp(34px, 6vw, 64px); }
.w3wrd-group + .w3wrd-group { display: none; }
.w3wrd-toggle, .w3wrd-r { display: none; }
}
</style>
<script>
(function () {
var root = document.querySelector(".w3wrd");
if (!root) return;
var btn = root.querySelector(".w3wrd-toggle");
root.querySelectorAll(".w3wrd-track").forEach(function (t) { t.appendChild(t.firstElementChild.cloneNode(true)); });
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play the words" : "Pause the words";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: Only the upper row stays, wrapped onto a few lines at a smaller size, with the button removed.
Running cost: Two compositor transforms on two tracks; both freeze through animation-play-state when off screen.
- Set `--w3wrd-size` to make the words larger or smaller; the clamp keeps phones readable.
- The lower band runs at `--w3wrd-speed` times 1.25; change that multiplier to separate the two rhythms more.
- Edit `rowA` and `rowB` in React, or the spans inside each group in the HTML.
Photo Strip Marquee With Captioned Frames
Portrait photos from a plant nursery glide across a deep forest green band, every other frame dropped a little lower so the belt has a gentle rhythm. Each frame carries a short caption and a running number. Pointer hover holds the belt, and a light pill button pauses it for good. Use it for a gallery strip on a garden centre, studio or venue page.
<section class="w3pho">
<div class="w3pho-head">
<div>
<p class="w3pho-kicker">Bramblecote Nursery</p>
<h2>Three glasshouses, open to wander every weekend</h2>
</div>
<button class="w3pho-toggle" type="button" aria-pressed="false">Pause photos</button>
</div>
<div class="w3pho-view">
<div class="w3pho-track">
<ul class="w3pho-group">
<li><figure><div class="w3pho-img"><img src="https://images.pexels.com/photos/12096571/pexels-photo-12096571.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Greenhouse aisle under a glass roof with rows of white hanging pots" width="240" height="320" loading="eager"></div><figcaption><span>The long house</span><small>01</small></figcaption></figure></li>
<li class="w3pho-low"><figure><div class="w3pho-img"><img src="https://images.pexels.com/photos/32532120/pexels-photo-32532120.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Young snapdragon seedlings in small pots on a tray" width="240" height="320" loading="eager"></div><figcaption><span>Spring seedlings</span><small>02</small></figcaption></figure></li>
<li><figure><div class="w3pho-img"><img src="https://images.pexels.com/photos/16960870/pexels-photo-16960870.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Striped silver and green calathea leaves in soft light" width="240" height="320" loading="eager"></div><figcaption><span>Calathea</span><small>03</small></figcaption></figure></li>
<li class="w3pho-low"><figure><div class="w3pho-img"><img src="https://images.pexels.com/photos/6913563/pexels-photo-6913563.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Large leaved tropical plants in pots on a greenhouse shelf" width="240" height="320" loading="eager"></div><figcaption><span>Tropical bench</span><small>04</small></figcaption></figure></li>
<li><figure><div class="w3pho-img"><img src="https://images.pexels.com/photos/33614722/pexels-photo-33614722.jpeg?auto=compress&cs=tinysrgb&w=600" alt="Begonia leaves with white spots on a dark green surface" width="240" height="320" loading="eager"></div><figcaption><span>Spotted begonia</span><small>05</small></figcaption></figure></li>
</ul>
</div>
</div>
</section>
<style>
/* Change these: loop time, frame width, how far alternate frames drop, forest background. */
.w3pho { --w3pho-speed: 48s; --w3pho-w: 200px; --w3pho-drop: 40px; --w3pho-bg: #1b2a21; }
.w3pho { overflow: hidden; background: var(--w3pho-bg); color: #eef1e6; padding: 80px 0; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3pho-head { max-width: 72rem; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.w3pho-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #b9cf9a; }
.w3pho-head h2 { margin: 12px 0 0; max-width: 36rem; font-size: clamp(28px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.w3pho-toggle { height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: #eef1e6; color: var(--w3pho-bg); font: 500 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3pho-toggle:hover { background: #fff; }
.w3pho-toggle:focus-visible { outline: 2px solid #eef1e6; outline-offset: 3px; }
.w3pho-view { margin-top: 48px; overflow: hidden; }
.w3pho-track { display: flex; width: max-content; animation: w3pho-run var(--w3pho-speed) linear infinite; }
.w3pho-group { display: flex; align-items: flex-start; gap: 24px; padding: 0 24px 0 0; margin: 0; list-style: none; }
.w3pho-low { margin-top: var(--w3pho-drop); }
.w3pho-group figure { margin: 0; width: var(--w3pho-w); }
@media (min-width: 640px) { .w3pho-group figure { width: calc(var(--w3pho-w) + 40px); } }
.w3pho-img { aspect-ratio: 3 / 4; overflow: hidden; border-radius: 12px; background: #2a3d30; }
.w3pho-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.w3pho-group figcaption { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; font-size: 14px; font-weight: 500; }
.w3pho-group small { font: 12px ui-monospace, Menlo, monospace; color: #a9bba6; }
.w3pho[data-paused] .w3pho-track, .w3pho[data-off] .w3pho-track, .w3pho-view:hover .w3pho-track { animation-play-state: paused; }
@keyframes w3pho-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
.w3pho-view { overflow-x: auto; scroll-snap-type: x mandatory; }
.w3pho-track { animation: none; padding: 0 20px; }
.w3pho-group li { scroll-snap-align: start; }
.w3pho-group[aria-hidden], .w3pho-toggle { display: none; }
}
</style>
<script>
(function () {
var root = document.querySelector(".w3pho");
if (!root) return;
var track = root.querySelector(".w3pho-track"), btn = root.querySelector(".w3pho-toggle");
var copy = track.firstElementChild.cloneNode(true);
copy.setAttribute("aria-hidden", "true");
copy.querySelectorAll("img").forEach(function (im) { im.alt = ""; });
track.appendChild(copy);
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play photos" : "Pause photos";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: Photos stand still in a swipeable row that snaps frame by frame, each with its caption.
Running cost: Five photos loaded up front with fixed aspect boxes; the belt is one transform, halted off screen.
- Change `--w3pho-drop` to make the staggered frames sit higher or lower, or set it to 0 for a straight line.
- Widen frames with `--w3pho-w` and keep the 3 by 4 aspect box so nothing jumps while photos load.
- Replace the `photos` entries with your own images, matching each alt text to what the photo shows.
Pill Button With Looping Marquee Label
A dark navy pill for a tailoring shop's booking link. On hover or keyboard focus its label slips upward and a pale blue strip rises in its place, looping the same words with arrows like a small ticker inside the button. While nobody is pointing, it lights itself every few seconds so the preview shows the effect. Fits the main call to action on a quiet, typographic page.
<section class="w3btn">
<div class="w3btn-inner">
<p class="w3btn-kicker">Mercer Row Tailoring</p>
<h2>A suit cut to you takes three fittings and about six weeks.</h2>
<p class="w3btn-copy">Bring a jacket you already love. We measure, choose cloth together and pin a first try-on the same afternoon.</p>
<div class="w3btn-actions">
<a class="w3btn-pill" href="#"><span class="w3btn-still">Book a fitting</span></a>
<a class="w3btn-alt" href="#">See cloths and prices</a>
</div>
</div>
</section>
<style>
/* Change these: loop time of the label, button colour, lit colour, page colour. */
.w3btn { --w3btn-speed: 4s; --w3btn-ink: #13293d; --w3btn-lit: #b8d3e8; --w3btn-bg: #e9eef3; }
.w3btn { background: var(--w3btn-bg); color: var(--w3btn-ink); padding: 88px 20px; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3btn-inner { max-width: 48rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; }
.w3btn-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #3d5a74; }
.w3btn-inner h2 { margin: 16px 0 0; font-size: clamp(30px, 5vw, 48px); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.w3btn-copy { margin: 20px 0 0; max-width: 36rem; font-size: 16px; line-height: 1.65; color: #3d5a74; }
.w3btn-actions { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }
.w3btn-pill { position: relative; display: inline-flex; height: 60px; min-width: 240px; overflow: hidden; border-radius: 999px; background: var(--w3btn-ink); color: #f2f5f8; text-decoration: none; font-size: 16px; font-weight: 600; box-shadow: 0 14px 30px -18px rgba(19,41,61,.7); }
.w3btn-still, .w3btn-run { position: absolute; inset: 0; display: flex; align-items: center; transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease; }
.w3btn-still { justify-content: center; padding: 0 32px; }
.w3btn-still::after, .w3btn-group span::after { content: "\2192"; margin-left: 12px; font-weight: 400; }
.w3btn-run { overflow: hidden; transform: translateY(100%); opacity: 0; background: var(--w3btn-lit); color: var(--w3btn-ink); }
.w3btn-track { display: flex; width: max-content; animation: w3btn-run var(--w3btn-speed) linear infinite; animation-play-state: paused; }
.w3btn-group { display: flex; gap: 14px; padding-right: 14px; white-space: nowrap; }
.w3btn-on .w3btn-still, .w3btn-pill:focus-visible .w3btn-still { transform: translateY(-100%); opacity: 0; }
.w3btn-on .w3btn-run, .w3btn-pill:focus-visible .w3btn-run { transform: none; opacity: 1; }
.w3btn-on .w3btn-track, .w3btn-pill:focus-visible .w3btn-track { animation-play-state: running; }
@media (hover: hover) {
.w3btn-pill:hover .w3btn-still { transform: translateY(-100%); opacity: 0; }
.w3btn-pill:hover .w3btn-run { transform: none; opacity: 1; }
.w3btn-pill:hover .w3btn-track { animation-play-state: running; }
}
.w3btn-pill:focus-visible { outline: 2px solid var(--w3btn-ink); outline-offset: 4px; }
.w3btn-alt { display: inline-flex; align-items: center; height: 48px; padding: 0 20px; color: var(--w3btn-ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-color: #8aa3b8; text-underline-offset: 4px; }
.w3btn-alt:focus-visible { outline: 2px solid var(--w3btn-ink); outline-offset: 2px; border-radius: 999px; }
@keyframes w3btn-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .w3btn-still, .w3btn-run { transition: none; } .w3btn-track { animation: none; padding-left: 24px; } }
</style>
<script>
(function () {
/* Change this: how long the idle demo keeps the button lit, then rests (ms). */
var IDLE_ON = 2600;
var root = document.querySelector(".w3btn");
if (!root) return;
var pill = root.querySelector(".w3btn-pill"), label = pill.textContent;
/* decorative looping copy of the label, hidden from screen readers */
var run = document.createElement("span"), track = document.createElement("span"), group = document.createElement("span");
run.className = "w3btn-run"; run.setAttribute("aria-hidden", "true");
track.className = "w3btn-track"; group.className = "w3btn-group";
for (var n = 0; n < 3; n++) { var s = document.createElement("span"); s.textContent = label; group.appendChild(s); }
track.appendChild(group); track.appendChild(group.cloneNode(true));
run.appendChild(track); pill.appendChild(run);
if (matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var timer = 0, done = false;
pill.classList.add("w3btn-on");
var io = new IntersectionObserver(function (e) {
clearInterval(timer);
if (e[0].isIntersecting && !done) timer = setInterval(function () { pill.classList.toggle("w3btn-on"); }, IDLE_ON);
});
io.observe(root);
function hand() { done = true; clearInterval(timer); io.disconnect(); pill.classList.remove("w3btn-on"); }
root.addEventListener("pointerenter", hand, { once: true });
root.addEventListener("focusin", hand, { once: true });
})();
</script>
With reduced motion: Hover or focus swaps the button to its pale blue lit colour at once, with the label standing still.
Running cost: The tiny label loop only runs while the button is lit; at rest nothing animates.
- Change `LABEL` (or the link text in HTML); the looping copy is built from it.
- Set `--w3btn-lit` for the strip colour and `--w3btn-ink` for the resting button.
- Lower `--w3btn-speed` for a quicker loop inside the pill.
Review Card Marquee With Pause Button
Guest quotes for a small sea kayak outfitter travel past on cream cards with soft shadows, at a pace slow enough to read one in passing. Hovering a card or tabbing into the row stops it, and a teal outline button freezes the whole belt for anyone who wants to read every note. Fits a testimonial band on a tour, class or hospitality site.
<section class="w3rev">
<div class="w3rev-head">
<div>
<p class="w3rev-kicker">Tidewater Kayak Tours</p>
<h2 class="w3rev-title">What paddlers wrote after a morning on the water</h2>
</div>
<button class="w3rev-toggle" type="button" aria-pressed="false">Pause reviews</button>
</div>
<div class="w3rev-view">
<div class="w3rev-track">
<ul class="w3rev-group">
<li class="w3rev-card"><blockquote>Our guide spotted a seal colony before any of us saw the rocks. Calm water, good jokes, hot tea at the end.</blockquote><p><span class="w3rev-av" aria-hidden="true">P</span><span><b>Priya N.</b>Sunrise paddle</span></p></li>
<li class="w3rev-card"><blockquote>First time in a kayak and I never felt out of my depth. They paired me with a steady partner.</blockquote><p><span class="w3rev-av" aria-hidden="true">T</span><span><b>Tom W.</b>Harbour loop</span></p></li>
<li class="w3rev-card"><blockquote>The dry bags actually kept my phone dry. Small thing, but it told me they think about details.</blockquote><p><span class="w3rev-av" aria-hidden="true">I</span><span><b>Ines R.</b>Island crossing</span></p></li>
<li class="w3rev-card"><blockquote>We booked for the kids and ended up going back the next morning on our own.</blockquote><p><span class="w3rev-av" aria-hidden="true">D</span><span><b>Dana and Lou</b>Family half day</span></p></li>
<li class="w3rev-card"><blockquote>They called the evening before to move us an hour earlier because of the wind. Glad they did.</blockquote><p><span class="w3rev-av" aria-hidden="true">M</span><span><b>Marcus O.</b>Cliff caves</span></p></li>
<li class="w3rev-card"><blockquote>Lunch on the sand bar was the best sandwich of the whole holiday.</blockquote><p><span class="w3rev-av" aria-hidden="true">H</span><span><b>Hana K.</b>Full day coast</span></p></li>
</ul>
</div>
</div>
</section>
<style>
/* Change these: loop time, card width, sand background, accent teal. */
.w3rev { --w3rev-speed: 60s; --w3rev-card: 300px; --w3rev-bg: #efe5d4; --w3rev-teal: #1f4a4f; }
.w3rev { overflow: hidden; background: var(--w3rev-bg); padding: 80px 0; font-family: ui-sans-serif, system-ui, sans-serif; color: #2a241c; }
.w3rev-head { max-width: 72rem; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; }
.w3rev-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: #8a5a24; }
.w3rev-title { margin: 12px 0 0; max-width: 32rem; font-size: clamp(28px, 4vw, 36px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.w3rev-toggle { height: 44px; padding: 0 20px; border: 1px solid var(--w3rev-teal); border-radius: 999px; background: transparent; color: var(--w3rev-teal); font: 500 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3rev-toggle:hover { background: var(--w3rev-teal); color: #f6efe2; }
.w3rev-toggle:focus-visible { outline: 2px solid var(--w3rev-teal); outline-offset: 3px; }
.w3rev-view { margin-top: 40px; overflow: hidden; padding: 8px 0 16px; }
.w3rev-track { display: flex; width: max-content; animation: w3rev-run var(--w3rev-speed) linear infinite; }
.w3rev-group { display: flex; gap: 20px; padding: 0 20px 0 0; margin: 0; list-style: none; }
.w3rev-card { display: flex; flex-direction: column; justify-content: space-between; width: var(--w3rev-card); flex-shrink: 0; padding: 24px; border: 1px solid #e2d6c2; border-radius: 16px; background: #fffaf1; box-shadow: 0 1px 2px rgba(60,40,10,.06), 0 12px 28px -16px rgba(60,40,10,.25); }
@media (min-width: 640px) { .w3rev-card { width: calc(var(--w3rev-card) + 40px); } }
.w3rev-card blockquote { margin: 0; font-size: 15px; line-height: 1.65; color: #3b3226; }
.w3rev-card blockquote::before { content: "\201C"; display: block; height: 28px; font: 700 44px/1 ui-serif, Georgia, serif; color: #c08a4a; }
.w3rev-card p { display: flex; align-items: center; gap: 12px; margin: 20px 0 0; font-size: 14px; color: #6b5c48; }
.w3rev-card b { display: block; color: #2a241c; }
.w3rev-av { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--w3rev-teal); color: #f6efe2; font-size: 12px; font-weight: 600; }
.w3rev[data-paused] .w3rev-track, .w3rev[data-off] .w3rev-track, .w3rev-view:hover .w3rev-track, .w3rev-view:focus-within .w3rev-track { animation-play-state: paused; }
@keyframes w3rev-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
.w3rev-view { overflow-x: auto; scroll-snap-type: x mandatory; }
.w3rev-track { animation: none; padding: 0 20px; }
.w3rev-card { scroll-snap-align: start; }
.w3rev-group[aria-hidden] { display: none; }
.w3rev-toggle { display: none; }
}
</style>
<script>
(function () {
var root = document.querySelector(".w3rev");
if (!root) return;
var track = root.querySelector(".w3rev-track"), btn = root.querySelector(".w3rev-toggle");
var copy = track.firstElementChild.cloneNode(true);
copy.setAttribute("aria-hidden", "true");
track.appendChild(copy);
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play reviews" : "Pause reviews";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: The cards sit still in a row that people swipe or scroll sideways, snapping to each card.
Running cost: A single slow transform loop over six cards; the browser composites it and the observer halts it out of view.
- Raise `SPEED` or `--w3rev-speed` if your quotes run longer than two lines.
- Change `--w3rev-card` to make every card wider or narrower.
- Replace the objects in `reviews` with real guest notes, keeping name and trip short.
Scroll Velocity Marquee That Speeds And Reverses
Two bands of material names for a small architecture practice run at an easy pace on graphite, then rush ahead when you scroll down and swing backwards when you scroll up, easing back to rest when the scrolling stops. It reads the box's own scroll, so it works inside a preview frame. Suits a portfolio or studio page that wants motion tied to the reader.
<section class="w3vel">
<div class="w3vel-bar">
<p class="w3vel-hint">Scroll inside</p>
<button class="w3vel-toggle" type="button" aria-pressed="false">Pause words</button>
</div>
<div class="w3vel-intro">
<p class="w3vel-kicker">Arden and Pell Architects</p>
<h2>Small buildings made from a short list of honest materials.</h2>
</div>
<!-- The words repeat materials named in the text below, so they are hidden from screen readers. -->
<div class="w3vel-view" aria-hidden="true">
<div class="w3vel-track"><span class="w3vel-group"><span>Oak</span><i>Limestone</i><span>Daylight</span><i>Lime plaster</i><span>Reclaimed brick</span><i>Larch</i></span></div>
<div class="w3vel-track w3vel-r"><span class="w3vel-group"><span>Oak</span><i>Limestone</i><span>Daylight</span><i>Lime plaster</i><span>Reclaimed brick</span><i>Larch</i></span></div>
</div>
<div class="w3vel-text">
<p>We design houses, studios and small public rooms. Most of our work uses oak and larch frames, limestone bases, lime plaster walls and reclaimed brick, chosen so a building ages well and can be repaired by a local trade.</p>
<p>Every project starts with a site visit at two times of day, because daylight decides where we put the windows before anything else is drawn.</p>
<p>We take on a few commissions a year so each one keeps the same two partners from first sketch to handover.</p>
<p>Recent work includes a timber reading room for a village library, a pair of limestone holiday cottages and a brick workshop behind a terrace house.</p>
<p>Write to the studio with a rough budget and a photo of the site, and we will reply with whether we are the right fit.</p>
</div>
</section>
<style>
/* Change these: resting loop time, box height (remove height and overflow to use page scroll), graphite colour, accent. */
.w3vel { --w3vel-speed: 28s; --w3vel-h: 620px; --w3vel-bg: #1c1d1f; --w3vel-accent: #c9a46a; }
.w3vel { position: relative; height: var(--w3vel-h); overflow-y: auto; background: var(--w3vel-bg); color: #ecebe7; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3vel-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: rgba(28,29,31,.95); }
.w3vel-hint { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: #a8a6a0; transition: opacity .4s ease; }
.w3vel[data-scrolled] .w3vel-hint { opacity: 0; }
.w3vel-toggle { height: 40px; padding: 0 16px; border: 1px solid #4a4c50; border-radius: 999px; background: transparent; color: #ecebe7; font: 500 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3vel-toggle:hover { background: #2a2b2e; }
.w3vel-toggle:focus-visible { outline: 2px solid #ecebe7; outline-offset: 2px; }
.w3vel-intro, .w3vel-text { max-width: 56rem; margin: 0 auto; padding: 32px 20px 48px; }
.w3vel-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--w3vel-accent); }
.w3vel-intro h2 { margin: 16px 0 0; max-width: 40rem; font-size: clamp(28px, 4vw, 36px); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.w3vel-view { overflow: hidden; border-top: 1px solid #36383c; border-bottom: 1px solid #36383c; padding: 14px 0; }
.w3vel-track { display: flex; width: max-content; animation: w3vel-run var(--w3vel-speed) linear infinite; }
.w3vel-track + .w3vel-track { margin-top: 8px; }
.w3vel-r { animation-direction: reverse; }
.w3vel-group { display: flex; gap: 48px; padding-right: 48px; white-space: nowrap; font-size: clamp(40px, 7vw, 88px); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.w3vel-group i { font-style: normal; color: transparent; -webkit-text-stroke: 1.2px #a8a6a0; }
.w3vel[data-paused] .w3vel-track, .w3vel[data-off] .w3vel-track { animation-play-state: paused; }
@keyframes w3vel-run { to { transform: translateX(-50%); } }
.w3vel-text { padding-top: 56px; color: #c4c2bc; font-size: 16px; line-height: 1.65; }
.w3vel-text p { margin: 0 0 24px; }
@media (prefers-reduced-motion: reduce) {
.w3vel-track { animation: none; width: auto; padding: 0 20px; }
.w3vel-group { flex-wrap: wrap; white-space: normal; column-gap: 28px; font-size: clamp(32px, 5vw, 56px); }
.w3vel-group + .w3vel-group, .w3vel-r, .w3vel-toggle { display: none; }
}
</style>
<script>
(function () {
/* Change these: speed added per pixel scrolled in a frame, fastest multiple. */
var BOOST = 0.12, MAX = 7;
var root = document.querySelector(".w3vel");
if (!root) return;
var btn = root.querySelector(".w3vel-toggle"), tracks = root.querySelectorAll(".w3vel-track");
tracks.forEach(function (t) { t.appendChild(t.firstElementChild.cloneNode(true)); });
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play words" : "Pause words";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
if (matchMedia("(prefers-reduced-motion: reduce)").matches) return;
var anims = [], last = root.scrollTop, push = 0, rate = 1, sign = 1, frame = 0;
tracks.forEach(function (t) { var a = t.getAnimations()[0]; if (a) anims.push(a); });
function tick() {
var target = sign * (1 + Math.min(Math.abs(push) * BOOST, MAX - 1));
rate += (target - rate) * 0.12;
push *= 0.88;
anims.forEach(function (a) { a.playbackRate = rate; });
frame = Math.abs(push) > 0.1 || Math.abs(rate - target) > 0.01 ? requestAnimationFrame(tick) : 0;
}
/* The box scrolls itself here. For page scroll, listen on window and read scrollY. */
root.addEventListener("scroll", function () {
var d = root.scrollTop - last;
last = root.scrollTop;
if (d) sign = d > 0 ? 1 : -1;
push += d;
root.setAttribute("data-scrolled", "");
if (!frame) frame = requestAnimationFrame(tick);
}, { passive: true });
})();
</script>
With reduced motion: One band of material names sits still and wrapped, and scrolling only moves the page.
Running cost: Scrolling only changes the playback rate of existing CSS animations, and the short frame loop ends once the speed settles.
- Raise `BOOST` for a stronger kick from each scroll, or lower `MAX` to cap how fast the words can run.
- Change `--w3vel-speed` (or `SPEED`) for the resting pace.
- To use the page scroll, drop `--w3vel-h` and the overflow rule, then listen on window and read scrollY as the comment says.
Tilted Crossing Marquee Bands For Event Dates
A clay coloured band and a dark ink band cross at slight opposite angles and run in opposite directions, announcing a pottery open weekend like tape across a studio door. The front band lifts off the page with a soft shadow. The dates, times and activities are also written out in a paragraph beneath, so the bands can stay decorative. Use it for a launch, open day or sale.
<section class="w3tlt">
<!-- Both bands repeat the paragraph below, so they are hidden from screen readers. -->
<div class="w3tlt-stage" aria-hidden="true">
<div class="w3tlt-band w3tlt-back"><div class="w3tlt-track w3tlt-r"><span class="w3tlt-group"><i>Throwing demos</i><i>Seconds sale</i><i>Tea in the yard</i><i>Kids clay table</i></span></div></div>
<div class="w3tlt-band w3tlt-front"><div class="w3tlt-track"><span class="w3tlt-group"><i>Open studio weekend</i><i>18 and 19 October</i><i>Free entry</i><i>Kiln firing at noon</i></span></div></div>
</div>
<div class="w3tlt-info">
<div>
<h2>Redbank Pottery open studio</h2>
<p>Saturday 18 and Sunday 19 October, 10:00 to 17:00, free entry. Throwing demos, a seconds sale, tea in the yard and a clay table for children, with the kiln opened at noon.</p>
</div>
<button class="w3tlt-toggle" type="button" aria-pressed="false">Pause bands</button>
</div>
</section>
<style>
/* Change these: loop time, tilt of each band, terracotta and ink colours. */
.w3tlt { --w3tlt-speed: 30s; --w3tlt-tilt-a: -4deg; --w3tlt-tilt-b: 3.5deg; --w3tlt-clay: #b4532a; --w3tlt-ink: #2a1a12; }
.w3tlt { overflow: hidden; background: #f1e4d8; color: var(--w3tlt-ink); padding: 64px 0; font-family: ui-sans-serif, system-ui, sans-serif; }
.w3tlt-stage { position: relative; height: 220px; }
.w3tlt-band { position: absolute; left: -10%; right: -10%; top: 50%; overflow: hidden; }
.w3tlt-front { transform: translateY(-50%) rotate(var(--w3tlt-tilt-a)); background: var(--w3tlt-clay); color: #fff6ee; z-index: 2; box-shadow: 0 18px 30px -18px rgba(70,30,10,.55); }
.w3tlt-back { transform: translateY(-50%) rotate(var(--w3tlt-tilt-b)); background: var(--w3tlt-ink); color: #f1e4d8; }
.w3tlt-track { display: flex; width: max-content; animation: w3tlt-run var(--w3tlt-speed) linear infinite; }
.w3tlt-r { animation-direction: reverse; animation-duration: calc(var(--w3tlt-speed) * 1.4); }
.w3tlt-group { display: flex; align-items: center; height: 64px; white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: -.01em; text-transform: uppercase; }
.w3tlt-group i { font-style: normal; display: flex; align-items: center; }
.w3tlt-group i::after { content: ""; width: 10px; height: 10px; margin: 0 26px; background: currentColor; opacity: .7; transform: rotate(45deg); }
.w3tlt-back .w3tlt-group { height: 52px; font-size: 16px; font-weight: 600; letter-spacing: .12em; }
.w3tlt[data-paused] .w3tlt-track, .w3tlt[data-off] .w3tlt-track { animation-play-state: paused; }
@keyframes w3tlt-run { to { transform: translateX(-50%); } }
.w3tlt-info { max-width: 64rem; margin: 24px auto 0; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.w3tlt-info h2 { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em; }
.w3tlt-info p { margin: 8px 0 0; max-width: 36rem; font-size: 16px; line-height: 1.6; color: #5a4234; }
.w3tlt-toggle { height: 44px; padding: 0 20px; border: 2px solid var(--w3tlt-ink); border-radius: 999px; background: transparent; color: var(--w3tlt-ink); font: 600 14px ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.w3tlt-toggle:hover { background: var(--w3tlt-ink); color: #f1e4d8; }
.w3tlt-toggle:focus-visible { outline: 2px solid var(--w3tlt-clay); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .w3tlt-track { animation: none; } .w3tlt-toggle { display: none; } }
</style>
<script>
(function () {
var root = document.querySelector(".w3tlt");
if (!root) return;
var btn = root.querySelector(".w3tlt-toggle");
root.querySelectorAll(".w3tlt-track").forEach(function (t) { t.appendChild(t.firstElementChild.cloneNode(true)); });
btn.addEventListener("click", function () {
var on = btn.getAttribute("aria-pressed") !== "true";
btn.setAttribute("aria-pressed", on);
btn.textContent = on ? "Play bands" : "Pause bands";
root.toggleAttribute("data-paused", on);
});
new IntersectionObserver(function (e) { root.toggleAttribute("data-off", !e[0].isIntersecting); }).observe(root);
})();
</script>
With reduced motion: Both bands keep their tilt and colour but hold still, and the event paragraph below them is unchanged.
Running cost: Two rotated strips each move one inner transform; nothing repaints beyond the compositor.
- Adjust `--w3tlt-tilt-a` and `--w3tlt-tilt-b` for steeper or flatter angles; keep them small so text stays readable.
- Change `--w3tlt-clay` and `--w3tlt-ink` to recolour the two bands.
- Edit the `front` and `back` arrays with your own short phrases; three to five words each reads best.
Performance notes
The loop is one CSS animation on one transform, so it runs on the compositor and costs almost nothing per frame. The track is only twice as wide as its content, and the copies are made once in the HTML or by a few lines of script, never re-created while it runs.
Several marquees on one page add up, so each pauses with animation-play-state when it scrolls out of view. Logos are inline SVG or small images with set dimensions, which keeps the row from jumping as they load and the width of the loop exact.
Questions
Is the HTML marquee tag still usable?
No. MDN marks the marquee element as deprecated, strongly discourages it and points to CSS animations with transforms instead. It also gives you no clean way to pause the movement or keep duplicate copies away from screen readers.
How do I make a marquee loop with no gap?
Repeat the items so the track holds two identical halves, then animate translateX from 0 to minus 50 percent with linear timing and infinite repeats. When the first half has fully left, the second sits exactly where the first began.
How do I pause a CSS marquee on hover?
Set animation-play-state: paused on the track when its container matches :hover or :focus-within. The pieces here also add a pause button, because hover does not exist on touch screens.
Are scrolling marquees accessible?
They can be. Mark the duplicated copy aria-hidden, keep links focusable only once, give people a way to pause anything that moves for more than five seconds, and stop the motion for prefers-reduced-motion.
More collections: CSS Hover Effects and Magnetic Buttons, CSS Text Animations, Scroll Animations Without a Library. All marquees. Build your site free to have a full site built around them.
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App