HTML <marquee> Tag

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 3 Examples
Legacy Animation

What You’ll Learn

The <marquee> tag is a classic HTML element for scrolling text and images. This guide explains how it worked, why it is deprecated, and what to use instead.

01

Historical Syntax

How <marquee> wrapped content to create scrolling effects.

02

Deprecated Status

Why HTML5 removed marquee and modern browsers discourage it.

03

Key Attributes

Control direction, behavior, speed, and looping with tag attributes.

04

Common Use Cases

Scrolling text banners and image tickers from early web design.

05

CSS Replacement

Build accessible scroll effects with @keyframes and transforms.

06

Legacy Maintenance

Recognize marquee in old code and migrate to modern techniques.

What Is the <marquee> Tag?

The <marquee> element is an HTML tag used to create scrolling text or images horizontally or vertically within a web page. It was widely used in the early days of the web for attention-grabbing banners, news tickers, and promotional messages.

⚠️
Deprecated in HTML5 — Use CSS Instead

The <marquee> tag is deprecated and no longer part of modern HTML standards. Its usage is strongly discouraged due to accessibility concerns, unpredictable browser behavior, and poor user experience. Use CSS animations or JavaScript for scrolling effects in new projects.

Despite its nostalgic appeal, understanding marquee helps you read legacy HTML and maintain older systems. For all new development, prefer CSS-based scrolling with prefers-reduced-motion support.

📝 Syntax

Enclose the content you want to scroll between opening and closing <marquee> tags. Customize direction, behavior, and speed with attributes:

syntax.html
<marquee
  direction="left"
  behavior="scroll"
  scrollamount="3"
>
  Your Scrolling Content Here
</marquee>

Syntax Rules

  • <marquee> requires both opening and closing tags.
  • Place text, images, or other inline content inside the element.
  • Attributes control scroll direction, speed, and looping behavior.
  • Modern browsers may ignore scrolling or render content as static text.

⚡ Quick Reference

TopicCode SnippetNotes
Basic scroll<marquee>Hello</marquee>Deprecated
Direction leftdirection="left"Scroll right to left
Direction updirection="up"Vertical scroll
Speedscrollamount="5"Higher = faster
Infinite looploop="-1"Never stops
CSS replacement@keyframes scroll-leftModern approach

⚖️ <marquee> vs CSS Animation

CSS gives you full control over timing, direction, and accessibility that the legacy tag never offered:

Feature<marquee>CSS @keyframes
StatusDeprecated in HTML5Valid in all modern browsers
Speed controlscrollamount / scrolldelayanimation-duration
Directiondirection attributetransform: translateX()
AccessibilityNo reduced-motion supportprefers-reduced-motion
Best practiceAvoid in new codeUse for ticker effects sparingly

🧰 Attributes

The <marquee> tag supports several attributes to control scrolling behavior:

direction Direction

Sets scroll direction: left, right, up, or down.

direction="left"
behavior Motion

Defines how content moves: scroll (continuous), slide (enters and stops), or alternate (bounces back).

behavior="scroll"
scrollamount Speed

Pixels moved per step. Higher values create faster scrolling.

scrollamount="5"
scrolldelay Timing

Milliseconds between scroll steps. Works with scrollamount to fine-tune speed.

scrolldelay="85"
loop Repeat

Number of times the marquee loops. Use -1 for infinite looping.

loop="-1"
width / height Size

Sets the visible area dimensions in pixels or percentages.

width="100%" height="40"

All attributes are legacy. Prefer CSS animation and transform for scrolling effects in modern HTML.

Examples Gallery

Historical marquee patterns plus the modern CSS replacement. Native marquee may not work in all modern browsers—demos use CSS animation to show the scrolling effect.

👀 Live Preview

Modern browsers may ignore native <marquee>. This demo uses CSS animation to show the historical scrolling effect:

Static: Welcome to our website.

Welcome to Our Website!

📚 Common Use Cases

Developers once used <marquee> for welcome banners, news tickers, and scrolling image galleries. Today use CSS or JavaScript carousels with pause controls and reduced-motion support.

Scrolling Text

The primary use case: create attention-grabbing scrolling text with behavior and direction.

⚠️ Deprecated tag — native marquee may not scroll in modern browsers.
scrolling-text.html
<marquee behavior="scroll" direction="left">
  Welcome to Our Website!
</marquee>
Try It Yourself

Scrolling Images

Place multiple <img> elements inside a marquee to create a scrolling image gallery.

scrolling-images.html
<marquee behavior="scroll" direction="left">
  <img src="image1.jpg" alt="Image 1">
  <img src="image2.jpg" alt="Image 2">
  <img src="image3.jpg" alt="Image 3">
</marquee>
Try It Yourself

Modern CSS Animation Replacement

This is what beginners should use today. CSS gives control over speed, direction, and accessibility via prefers-reduced-motion.

css-replacement.html
<style>
  .ticker {
    overflow: hidden;
    white-space: nowrap;
    background: #f1f5f9;
    padding: 0.5rem 0;
  }
  .ticker span {
    display: inline-block;
    animation: scroll-left 12s linear infinite;
  }
  @keyframes scroll-left {
    from { transform: translateX(100%); }
    to   { transform: translateX(-100%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .ticker span { animation: none; }
  }
</style>
<div class="ticker">
  <span>Welcome to Our Website!</span>
</div>
Try It Yourself

♿ Accessibility

Scrolling content creates serious accessibility problems:

  • Motion sensitivity — moving text can trigger dizziness or nausea (vestibular disorders)
  • Reading difficulty — users cannot comfortably read content that scrolls continuously
  • WCAG guidelines — avoid content that moves automatically without user control
  • prefers-reduced-motion — always provide a static fallback when using CSS animations
  • Better alternatives — use static headlines, carousels with pause buttons, or subtle CSS effects

🧠 How <marquee> Worked

1

Author wrapped content in marquee

Place text or images inside <marquee> with direction and behavior attributes.

Markup
2

Browser scrolled the content

Supporting browsers moved content pixel-by-pixel based on scrollamount and scrolldelay.

Rendering
3

HTML5 deprecated the tag

Standards bodies removed marquee due to accessibility and UX concerns. Browser support became inconsistent.

Evolution
=

Today: use CSS animations

Learn marquee for history. Build scroll effects with CSS and respect prefers-reduced-motion.

Browser Support

Although widely supported in older browsers, the <marquee> tag is deprecated in HTML5 and may not scroll in modern browser versions. Test carefully and prefer CSS alternatives.

Deprecated · Not in HTML5

Unreliable in modern browsers

Chrome, Firefox, Safari, and Edge may render marquee content as static text. Do not depend on native scrolling in production.

~20% Modern scroll support
Google Chrome Partial · May show static text
Partial
Mozilla Firefox Partial · Limited scrolling
Partial
Apple Safari Partial · May show static text
Partial
Microsoft Edge Partial · Chromium behavior
Partial
Internet Explorer Legacy · Full scroll support
Legacy only
Opera Partial · Chromium-based
Partial

Why marquee was deprecated

Accessibility harm, lack of user control, and better CSS alternatives drove universal deprecation.

Motion sensitivity Auto-scrolling text violates inclusive design principles
A11y
🎨
CSS @keyframes Controlled animation with prefers-reduced-motion support
Replacement
<marquee> tag Deprecated · unreliable

Bottom line: Do not use <marquee> in new projects. Use CSS animations with prefers-reduced-motion when scrolling effects are truly needed.

Conclusion

While the <marquee> tag remains a nostalgic element from the early days of the web, its usage is no longer recommended for modern web development practices.

However, understanding its implementation can still be valuable for maintaining compatibility with legacy systems. For new projects, use CSS-based scrolling with accessibility safeguards.

💡 Best Practices

✅ Do

  • Use CSS @keyframes for scrolling ticker effects
  • Honor prefers-reduced-motion in your stylesheets
  • Provide pause controls for any auto-moving content
  • Learn marquee only to read legacy HTML

❌ Don’t

  • Use <marquee> in new HTML code
  • Create excessive or distracting scrolling content
  • Assume marquee scrolls in all modern browsers
  • Rely on scrolling alone for critical information

Key Takeaways

Knowledge Unlocked

Six truths every developer should know about <marquee>

Bookmark these before you add scrolling effects to your pages.

6
Core concepts
🚫 02

Deprecated in HTML5

Removed from modern standards due to UX and a11y issues.

Status
🎨 03

Use CSS Instead

@keyframes animations replace native scrolling.

Migration
⚙️ 04

Attribute Control

direction, behavior, and scrollamount tuned motion.

Attributes
05

Hurts Accessibility

Auto-scrolling text is hard to read and triggers motion sensitivity.

A11y
🔈 06

Reduced Motion

Always honor prefers-reduced-motion in CSS animations.

Policy

❓ Frequently Asked Questions

It creates horizontally or vertically scrolling text or images for banners, tickers, and promotional messages.
No. It is deprecated and strongly discouraged. Modern browsers may not scroll marquee content at all.
CSS @keyframes animations, CSS transforms, and JavaScript carousels with pause controls.
It sets scroll direction: left, right, up, or down.
Learn it for legacy HTML, but practice CSS scrolling effects for all new projects.

Learn the Modern Way

Skip obsolete marquee. Practice accessible CSS scrolling in the Try It editor.

Try CSS Animation →

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.

6 people found this page helpful