👀 Live Preview
Modern browsers may ignore native <marquee>. This demo uses CSS animation to show the historical scrolling effect:
Static: Welcome to our website.

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.
How <marquee> wrapped content to create scrolling effects.
Why HTML5 removed marquee and modern browsers discourage it.
Control direction, behavior, speed, and looping with tag attributes.
Scrolling text banners and image tickers from early web design.
Build accessible scroll effects with @keyframes and transforms.
Recognize marquee in old code and migrate to modern techniques.
<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.
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.
Enclose the content you want to scroll between opening and closing <marquee> tags. Customize direction, behavior, and speed with attributes:
<marquee
direction="left"
behavior="scroll"
scrollamount="3"
>
Your Scrolling Content Here
</marquee><marquee> requires both opening and closing tags.| Topic | Code Snippet | Notes |
|---|---|---|
| Basic scroll | <marquee>Hello</marquee> | Deprecated |
| Direction left | direction="left" | Scroll right to left |
| Direction up | direction="up" | Vertical scroll |
| Speed | scrollamount="5" | Higher = faster |
| Infinite loop | loop="-1" | Never stops |
| CSS replacement | @keyframes scroll-left | Modern approach |
<marquee> vs CSS AnimationCSS gives you full control over timing, direction, and accessibility that the legacy tag never offered:
| Feature | <marquee> | CSS @keyframes |
|---|---|---|
| Status | Deprecated in HTML5 | Valid in all modern browsers |
| Speed control | scrollamount / scrolldelay | animation-duration |
| Direction | direction attribute | transform: translateX() |
| Accessibility | No reduced-motion support | prefers-reduced-motion |
| Best practice | Avoid in new code | Use for ticker effects sparingly |
The <marquee> tag supports several attributes to control scrolling behavior:
direction DirectionSets scroll direction: left, right, up, or down.
direction="left"behavior MotionDefines how content moves: scroll (continuous), slide (enters and stops), or alternate (bounces back).
behavior="scroll"scrollamount SpeedPixels moved per step. Higher values create faster scrolling.
scrollamount="5"scrolldelay TimingMilliseconds between scroll steps. Works with scrollamount to fine-tune speed.
scrolldelay="85"loop RepeatNumber of times the marquee loops. Use -1 for infinite looping.
loop="-1"width / height SizeSets 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.
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.
Modern browsers may ignore native <marquee>. This demo uses CSS animation to show the historical scrolling effect:
Static: Welcome to our website.
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.
The primary use case: create attention-grabbing scrolling text with behavior and direction.
<marquee behavior="scroll" direction="left">
Welcome to Our Website!
</marquee>Place multiple <img> elements inside a marquee to create a scrolling image gallery.
<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>This is what beginners should use today. CSS gives control over speed, direction, and accessibility via prefers-reduced-motion.
<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>Scrolling content creates serious accessibility problems:
Place text or images inside <marquee> with direction and behavior attributes.
Supporting browsers moved content pixel-by-pixel based on scrollamount and scrolldelay.
Standards bodies removed marquee due to accessibility and UX concerns. Browser support became inconsistent.
Learn marquee for history. Build scroll effects with CSS and respect prefers-reduced-motion.
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.
Chrome, Firefox, Safari, and Edge may render marquee content as static text. Do not depend on native scrolling in production.
Accessibility harm, lack of user control, and better CSS alternatives drove universal deprecation.
Bottom line: Do not use <marquee> in new projects. Use CSS animations with prefers-reduced-motion when scrolling effects are truly needed.
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.
@keyframes for scrolling ticker effectsprefers-reduced-motion in your stylesheetsmarquee only to read legacy HTML<marquee> in new HTML code<marquee>Bookmark these before you add scrolling effects to your pages.
<marquee> moved text and images across the page.
Removed from modern standards due to UX and a11y issues.
Status@keyframes animations replace native scrolling.
direction, behavior, and scrollamount tuned motion.
Auto-scrolling text is hard to read and triggers motion sensitivity.
A11yAlways honor prefers-reduced-motion in CSS animations.
@keyframes animations, CSS transforms, and JavaScript carousels with pause controls.left, right, up, or down.Skip obsolete marquee. Practice accessible CSS scrolling in the Try It editor.
6 people found this page helpful