HTML <marquee> Tag and Modern CSS Scrolling Text

The HTML <marquee> element was used to make text or images move automatically across a page. It is now an obsolete, non-standard element and should not be used for new websites.

If you are maintaining old HTML, the legacy examples below explain how marquee worked. For new pages, use CSS animation so movement, styling and accessibility can be controlled explicitly.

Modern recommendation: keep <marquee> only when you need to understand or maintain legacy content. Use CSS for new scrolling or animated interfaces, and provide a reduced-motion option.

Legacy <marquee> Example Top ↑

<marquee>This is an example of Marquee</marquee>

Legacy rendered example:

This is an example of Marquee

This browser-rendered example is retained so older pages can be understood, not as a recommendation for new HTML.

Example showing the legacy HTML marquee tag
HTML marquee tag to scroll or alternate text or image on web page with various speed and direction

Scrolling an Image with Legacy Marquee Top ↑

The old element could contain an image as well as text:

<marquee>
  <img src="images/left.jpg" alt="Left arrow">
</marquee>

Legacy rendered example:

Left arrow

Attributes such as direction, behavior, scrollamount, scrolldelay and loop were commonly used with marquee. They belong to this obsolete element and should not be treated as modern HTML animation APIs.

Modern CSS Alternative Top ↑

A modern version can use a normal element plus CSS animation. The content remains ordinary HTML, while movement is handled in CSS.

<div class="ticker">
  <span>Latest announcement from plus2net</span>
</div>
.ticker {
  overflow: hidden;
  white-space: nowrap;
}
.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 12s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

Unlike marquee attributes, CSS lets you control duration, easing, pause behavior, responsive layout and user motion preferences with standard styling tools.

Respect Reduced-Motion Preferences Top ↑

Continuous motion can be distracting or uncomfortable for some users. Disable non-essential animation when the user has requested reduced motion:

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

Important announcements should also remain readable without depending on motion to attract attention.

Legacy Marquee Properties Top ↑

The original Plus2net marquee tutorials cover the main legacy attributes separately:

Accessibility and Practical Guidance Top ↑

  • Do not rely on automatically moving text for essential instructions or alerts.
  • Give users enough time to read content and avoid unnecessary continuous movement.
  • Respect prefers-reduced-motion for non-essential animation.
  • Keep text selectable and understandable even when animation is disabled.
  • Use useful alt text for informative images; do not depend on movement to explain the image.

Common Marquee Mistakes Top ↑

Using <marquee> in a new project Top ↑

The element is obsolete and non-standard. Use CSS animation when motion is genuinely useful.

Using movement just to attract attention Top ↑

Constant motion can reduce readability. Use visual hierarchy, headings and appropriate styling before adding animation.

Assuming marquee attributes are modern CSS properties Top ↑

Attributes such as scrollamount, scrolldelay and behavior belong to the old marquee element. Modern animations use CSS properties and keyframes.

Ignoring reduced-motion settings Top ↑

Non-essential animation should be removable for users who prefer reduced motion.

Frequently Asked Questions Top ↑

Q1: Is the HTML marquee tag still valid for new websites?

No. The marquee element is obsolete and non-standard, so CSS animation should be used for new implementations.

Q2: Can marquee scroll images as well as text?

Legacy marquee elements could contain text, images and other inline content, but this behavior should now be recreated with standard HTML and CSS when needed.

Q3: What replaces marquee in modern HTML?

There is no direct replacement HTML tag. Use normal semantic HTML for the content and CSS animation for movement.

Q4: How do I control scrolling speed without marquee?

With CSS animation, change the animation duration. A longer duration produces slower movement and a shorter duration produces faster movement.

Q5: Should scrolling text stop for users who prefer reduced motion?

Non-essential movement should be disabled or reduced when the user has enabled a reduced-motion preference.

Marquee Direction MouseOver Control Marquee Speed Marquee Repeat Marquee Behavior



plus2net.com







ghygygygs

08-10-2013

can u add something else
Ajay

11-01-2015

I like to work in Html so please give me something new ideas to use in
webpage..

17-10-2020

Execellent

29-07-2022

hi, want to see how i can change the size letter

05-08-2022

You can just increase the font size or add one style property with higher font size



We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer