HTML <marquee> Tag

Beginner
5 min read
Updated: Oct 2026
3 examples
Obsolete

Definition and Usage

The <marquee> element once created a scrolling area of text (or other content). Authors tuned motion with presentational attributes such as direction and speed.

Learn it only to recognize legacy pages. For new work, use CSS animations and transforms, and honor prefers-reduced-motion so motion can stop when users request less of it.

Deprecated / Obsolete.

Do not use <marquee> in new HTML. MDN strongly discourages it; replace scrolling effects with CSS.

Still rendered in many browsers.

Legacy support exists for old documents, but that is not permission to ship new <marquee> markup.

HTML Syntax

syntax.html
<marquee>Scrolling text</marquee>

Modern approach: animate a normal element with CSS (see Example 3) — never rely on marquee for new sites.

Attributes

Legacy presentational attributes (study only). Prefer CSS for motion and layout today.

AttributeDescriptionTry it
behaviorLegacy — scroll (default), slide, or alternateTry it
directionLegacy — left (default), right, up, or downTry it
scrollamount / scrolldelayLegacy — step size (px) and delay (ms) between stepsAvoid
loopLegacy — repeat count; default continuousAvoid
bgcolor / size attrsPresentational — use CSS background / size insteadAvoid
Use CSS insteadCorrect today — animation + transform (+ reduced motion)Try it

Global Attributes

The <marquee> tag also supports the Global Attributes in HTML.

Live Preview

Compare legacy <marquee> with a CSS alternative. Prefer CSS for real pages.

demo style

Study only. New pages should animate with CSS and respect reduced motion.

Preview
Legacy scrolling text (do not use in new pages)

Using obsolete <marquee> — migrate to CSS.

HTML Examples

Short snippets for study and migration. Use Try It Yourself for a live editor.

Example 1 — Legacy marquee (Study Only)

Recognize old markup. Do not copy this into new projects.

HTML
<!-- Obsolete — for study only -->
<marquee>This text will scroll from right to left</marquee>
Try It Yourself

How It Works

  1. Spot the tag. <marquee> wraps the moving content.
  2. Default motion scrolls horizontally (typically right → left).
  3. Treat as legacy. Valid for understanding old pages only.
  4. Plan a CSS migrate for any real product UI.

Example 2 — Legacy direction / behavior

Old attributes controlled path and bounce. Do not use in new HTML.

HTML
<!-- Obsolete — for study only -->
<marquee direction="up">Scrolls upward</marquee>

<marquee behavior="alternate" direction="left">
  Bounces back and forth
</marquee>
Try It Yourself

How It Works

  1. direction set the travel axis (left, right, up, down).
  2. behavior chose scroll, slide, or alternate.
  3. Speed attrs (scrollamount, scrolldelay) adjusted step timing.
  4. Replace with CSS keyframes / transforms in modern pages.

Example 3 — Preferred: CSS Animation

Animate a normal element and respect reduced motion.

HTML
<p class="ticker">News headline scrolls with CSS</p>

<style>
  .ticker {
    overflow: hidden;
    white-space: nowrap;
    animation: slide 8s linear infinite;
  }
  @keyframes slide {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .ticker { animation: none; }
  }
</style>
Try It Yourself

How It Works

  1. Use a normal element (p, div, …) — not marquee.
  2. Animate with CSS (animation + transform).
  3. Add prefers-reduced-motion: reduce to disable continuous motion.
  4. Offer pause controls when motion is essential to the UI.

Edge Cases & Pitfalls

The main risk is treating browser display as permission to keep shipping marquee.

obsolete

Do not use in new HTML

Validators and accessibility audits flag <marquee>. Author CSS motion instead.

a11y

Continuous motion harms users

Auto-scrolling text is hard to read and can trigger vestibular issues. Respect reduced-motion preferences.

presentational

Legacy attributes are not a design system

bgcolor, hspace, and speed attrs mix presentation into HTML. Move look and motion to CSS.

nesting

Nested marquees

Old demos nested marquees for bounce tricks. That is fragile and unreadable — never recreate it.

migration

Replace, do not polyfill forever

When cleaning legacy pages, swap to CSS animation (or static text) rather than emulating every marquee quirk.

Browser Support

<marquee> is a deprecated HTML element. Prefer CSS animation in every modern document.

✓ Deprecated · Legacy rendering

<marquee>

Still displayed in many browsers for old content, but obsolete for authors. Use CSS for new work.

Legacy Author guidance
Google Chrome Renders (legacy)
Deprecated
Mozilla Firefox Renders (legacy)
Deprecated
Apple Safari Renders (legacy)
Deprecated
Microsoft Edge Renders (legacy)
Deprecated
Opera Renders (legacy)
Deprecated
Samsung Internet Renders (legacy)
Deprecated
Internet Explorer Supported (legacy)
Deprecated
<marquee> Do not use in new pages

Bottom line: Rendering support is not a green light. Migrate to CSS and treat marquee as archive knowledge.

Key Takeaways

  • Status: <marquee> is obsolete — study it, do not ship it.
  • Replacement: CSS animation + transform.
  • A11y: honor prefers-reduced-motion and avoid forced scrolling text.
  • Attributes: legacy speed/direction attrs stay in history books only.

One line: recognize <marquee>, replace it with CSS motion (or static text).

Default CSS Settings

Legacy engines implemented scrolling internally. Approximate modern recognition styling:

default.css
/* Legacy recognition only — do not depend on this */
marquee {
  display: inline-block;
  width: -webkit-fill-available; /* engine-specific historically */
}

/* Modern replacement sketch */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  animation: slide 8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none; }
}

Author new styles for your own elements. Leave marquee rules only while cleaning legacy CSS.

Frequently Asked Questions

No for new work. The marquee element is deprecated and obsolete. Do not use it in new pages.
It created a scrolling area of text. Authors controlled direction, speed, and bounce behavior with presentational attributes.
Use CSS animations and transforms for motion. Respect prefers-reduced-motion so users who need less motion are not forced into continuous scrolling.
Many browsers still render marquee for legacy pages, but support can shrink and behavior is inconsistent. Treat it as archive knowledge only.
Auto-moving text is hard to read, distracting, and problematic for vestibular disorders. Continuous motion without a pause control fails modern accessibility expectations.
They are legacy presentational attributes on an obsolete element. Learn them only to recognize old markup; do not ship them in new HTML.

Use CSS animation instead

Build controlled motion with animation and transform.

animation tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful