Marquee with Icons
A white scrolling line where each message is led by its pictogram: icon and label stay aligned and move together.
Updated
This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Gallery has 44 effects, including 6 free. Explore the category →
3 usage examples



How it works
Each <li> joins two pieces: an <i class="icmq-icon"> for the pictogram, then the label. The CSS sets them on one line, centred vertically, half a rem apart; the icon has its own size (--icmq-icon-size, 1.75 rem), independent from the text size (--icmq-size, 1.5 rem).
In the demo the icons are characters: ★, ♥, ⚡, ✎. You can put an <svg> or an <img> there instead; give them width: 1em; height: 1em so they follow --icmq-icon-size, as the shipped CSS does not size them. An SVG pictogram takes the text colour with stroke="currentColor".
The icon-label pair is copied as is by the script to fill the width, then the line moves at 55 px per second (data-speed). An item can be a link: wrap the icon and the label in the same <a>, alignment and spacing are kept.
Accessibility
- The icon is silent: it carries
aria-hidden="true", a screen reader only reads the label. So never leave a pictogram on its own, without text: it would not exist for those users. - No information by colour alone: if your icons encode a state (green, orange, red), also change their shape and write the state in the label.
- Stopping the scroll: a Pause button with
aria-pressed(click, finger, Space or Enter), on top of the stop when the mouse is over the line. - Keyboard: an item that is a link gets a 2 px outline drawn on the inside, around both icon and label; the copies are not in the Tab order.
- “Fewer animations” preference: the line is shown still, once, and is unrolled by hand; the icons stay next to their labels.
Browser compatibility
Laid out with flexbox and gap (Chrome 84, Firefox 63, Safari 14.1): that is what separates the icon from the label. CSS animation and 5 KB of script, no dependency. Measured on 4 December 2026 in Chromium, Firefox and WebKit: 55 px/s, full line at 390 and 1,900 px, two independent lines, a link item aligned like the others. Observed on macOS: the ⚡ character of the demo is drawn as a colour emoji in Chromium.
JavaScript off: the list appears once, fixed, icons included, and is scrolled by hand. Before Safari 14.1 or Chrome 84 the icon sticks to the label (no gap); the space you leave in the HTML between and the text does not count in flexbox, so add a margin to .icmq-icon.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0196-root" data-speed="55" data-direction="left">
<div class="icmq-band">
<div class="icmq-viewport">
<div class="icmq-track">
<ul class="icmq-group" role="list">
<li><i class="icmq-icon" aria-hidden="true">★</i> A label</li>
<li><i class="icmq-icon" aria-hidden="true"><svg viewBox="0 0 24 24">…</svg></i> A drawn pictogram</li>
<li><a href="/page"><i class="icmq-icon" aria-hidden="true">✎</i> An item as a link</a></li>
</ul>
</div>
</div>
<button type="button" class="icmq-toggle" aria-pressed="false" aria-label="Pause"></button>
</div>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
--icmq-icon-size |
1.75rem | Size of the pictogram, without touching the text. |
--icmq-size / --icmq-color |
1.5rem / #fff | Size and colour of the label; a character icon or a currentColor SVG takes the same colour. |
Items (HTML — .icmq-icon then the label) |
4 icon + text pairs | Icon as a character, <svg> or <img>; written once. |
.icmq-group > li { gap } |
.5rem | Distance between the icon and its label, to change in your stylesheet. |
--icmq-space |
3rem | Distance between two pairs. |
data-speed / data-direction |
55 / left | Speed in pixels per second and scrolling direction. |
--icmq-height / --icmq-bg / --icmq-padding |
180px / #0a0a0f / 1rem 0 | Black demo block around the line. |
--icmq-button / --icmq-button-size |
rgba(255, 255, 255, .8) / 2rem | Pause button. |
FAQ
︎) or, safer, replace it with a small <svg>: it will look the same everywhere and take the text colour..icmq-group > li: flex-direction: column stacks the icon above the label (the band gets taller), flex-direction: row-reverse moves it after. Reading order does not change, since the icon is not read.