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.
<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.<marquee>This is an example of Marquee</marquee>
Legacy rendered example:
This browser-rendered example is retained so older pages can be understood, not as a recommendation for new HTML.
The old element could contain an image as well as text:
<marquee>
<img src="images/left.jpg" alt="Left arrow">
</marquee>
Legacy rendered example:
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.
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.
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.
The original Plus2net marquee tutorials cover the main legacy attributes separately:
prefers-reduced-motion for non-essential animation.alt text for informative images; do not depend on movement to explain the image.The element is obsolete and non-standard. Use CSS animation when motion is genuinely useful.
Constant motion can reduce readability. Use visual hierarchy, headings and appropriate styling before adding animation.
Attributes such as scrollamount, scrolldelay and behavior belong to the old marquee element. Modern animations use CSS properties and keyframes.
Non-essential animation should be removable for users who prefer reduced motion.
No. The marquee element is obsolete and non-standard, so CSS animation should be used for new implementations.
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.
There is no direct replacement HTML tag. Use normal semantic HTML for the content and CSS animation for movement.
With CSS animation, change the animation duration. A longer duration produces slower movement and a shorter duration produces faster movement.
Non-essential movement should be disabled or reduced when the user has enabled a reduced-motion preference.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| 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 | |