GalleryPremium

Marquee with Icons

A white scrolling line where each message is led by its pictogram: icon and label stay aligned and move together.

CSSJSIcons

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

Service promises under the hero of a plant shop — one pictogram per promise — Marquee with Icons example 1

① Service promises under the hero of a plant shop — one pictogram per promise

WhenAt the foot of the first screen of Verdelune, under the headline and the potted plant, a fir-green band runs five commitments: delivered in 48 hours, taken back within 30 days, free repotting, a gardener who answers 7 days a week, plastic-free packaging.
WhyFive promises side by side do not fit on a phone; in a queue they fit in 52 px of height. The pictogram is recognised before the text is read: lorry, return arrow, pot, speech bubble, leaf.
Settingsdata-speed="42", --icmq-size: 13px, --icmq-icon-size: 22px, --icmq-space: 40px, --icmq-color: #f6f4ee, --icmq-padding: 15px 0, --icmq-height: auto, --icmq-bg: transparent; icons as 1em <svg>, tinted through color on .icmq-icon.
Today's pollen in the bottom bar of a pharmacy app — one shape and one colour per level — Marquee with Icons example 2

② Today's pollen in the bottom bar of a pharmacy app — one shape and one colour per level

WhenIn the patient area of the Orvaline pharmacy, under the prescription being prepared and the repeat reminder, a 34 px bar gives the day's pollen: birch high, oak and ash moderate, grasses low, ragweed none.
WhyThe information is secondary but useful every morning: it stays visible without taking the place of a card. The level reads three times: by shape (triangle, diamond, disc, ring), by colour and by word.
Settingsdata-speed="30", --icmq-size: 11px, --icmq-icon-size: 11px, --icmq-space: 26px, --icmq-button-size: 20px, --icmq-padding: 0; four small filled <svg>, one colour per level set on .icmq-icon.
The day's services, very large — lobby screen of a youth hostel — Marquee with Icons example 3

③ The day's services, very large — lobby screen of a youth hostel

WhenOn the screen hung opposite the front desk of Le Grand Hublot, under the time and three fixed panels (Wi-Fi, check-out, the evening's pancakes), a yellow banner scrolls breakfast, the laundry, the station shuttle and bikes for hire in 38 px letters.
WhyA lobby screen is read from afar and in passing: 48 px pictograms catch the eye before the sentence. Speed goes up to 120 px/s, because at this size a slow pace would look like a frozen screen.
Settingsdata-speed="120", --icmq-size: 38px, --icmq-icon-size: 48px, --icmq-space: 70px, --icmq-color: #0e1b2b, --icmq-padding: 16px 0; gap: 16px on .icmq-group > li to move the icon further from the text.

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.

Chrome 86+✓ Full (measured)
Firefox 85+✓ Full (measured)
Safari 15.4+✓ Full (WebKit engine measured)
Edge 86+✓ Full (Chromium engine)
iOS Safari 15.4+✓ Not verified on a device
Android Chrome 86+✓ Full (emulated touch, measured)

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):

index.html — structure
<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 / propertyDefaultEffect
--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

The shape of an item. In Basic Marquee, an item is a piece of text. Here it is a pair: an icon at its own size, hidden from screen readers, and a label, aligned and spaced by the CSS, including when the pair is a link. The scrolling is the same. If you only have text, Basic Marquee is enough; if you need neatly set pictograms, this one saves you writing it.
Some characters, such as ⚡, exist in two drawings and the system often picks the emoji. Add the text selector right after the character (&#xFE0E;) or, safer, replace it with a small <svg>: it will look the same everywhere and take the text colour.
Yes, with one line of CSS on .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.