Frontend.fyi

Recipe

CSS-only logo marquee

Bringing back some nostalgia

User avatar

Jeroen Reumkens PRO

CSS-only logo marquee

Unlock Playground Access

Playgrounds let you build, test, and share frontend ideas instantly — right in your browser. Access is included in PRO. Just want Playgrounds? Pick a plan below.

Maker

€5,- / month

Unlimited Playgrounds access to build, experiment, and share without limits.

Join for €5 per month

Champion

€10,- / month

All the benefits of Maker, plus you help Frontend.fyi grow and get a Champion badge on your profile.

Join for €10 per month

Cancel anytime — no commitment.
Upgrade to PRO anytime and get a partial refund.We'll credit 100% of your first 3 months and 50% of the rest toward the PRO lifetime price.

Already a member? Login

This CSS-only marquee is made in such a way that you don’t need to repeat the logos in the marquee to get the infinite scrolling effect. Something that is very common in other types of marquee implementations.

Implementation & configuration

This component has a few configuration options that you can set to configure the marquee.

CSS Variables in the HTML

These variables are required to render in the HTML for the marquee to work.

  • --num-items: A CSS variable on the marquee element, which needs to be set to the total number of items in the marquee.
  • --item-position: Each marquee-item should have a CSS variable with the current position of the item in the marquee. This should start at 1.

CSS Variables in the CSS

In the CSS you find all configurable variables on the .marquee element.

  • --speed: Total duration of the marquee animation.
  • --item-width: Width of each item in the marquee.
  • --item-gap: Spacing between each item in the marquee.

All items should be fixed width

An important condition to make the marquee work without duplicating its contents, is that every marquee item should have the same width. If you’re using this to for example create a text marquee where very item has a different, you need to use a different approach. That approach can be found in this CSS-only text marquee recipe.

Other interesting recipes

CSS FREE Recipe CSS-only text marquee

View recipe

CSS FREE Recipe Using CSS masks to fadeout content

View recipe