Table of contents
1.
Introduction
2.
What is a marquee tag in HTML?
2.1.
Example
2.2.
HTML
3.
Global Attributes
4.
Specific Attributes
5.
Event Attributes
6.
Supported Browsers
7.
Advantages and Disadvantages of the HTML Marquee Tag
7.1.
Advantages of Marquee
7.2.
Disadvantages of Marquee
8.
Frequently Asked Questions
8.1.
What is marquee direction?
8.2.
What is a marquee in HTML with an example?
8.3.
Is the marquee still used in HTML?
8.4.
What is a marquee display?
9.
Conclusion
Last Updated: Jun 12, 2025
Easy

HTML marquee Tag

Author Ravi Khorwal
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

The HTML marquee tag is a legacy feature that enables text or images to scroll or slide horizontally or vertically across a web page, creating a moving effect. Despite being outdated and generally discouraged in modern web design due to its lack of accessibility and control, it continues to intrigue with its simple way of adding motion to web content.

Marquee Tag in HTML

In this blog, we will learn about marquee tag in HTML.  We will learn about core concepts, real-world applications and much more. 

What is a marquee tag in HTML?

The HTML <marquee> tag is used to create scrolling images or text on web pages. It helps to scroll either from horizontally left to right or right to left, or vertically bottom to top or top to bottom.

Example

Let us look at an example to understand mthe arquee tag in HTML:

  • HTML

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Marquee Example</title>
</head>
<body>

<h1>Welcome to the Marquee Example</h1>

<marquee behavior="scroll" direction="left">
This text is scrolling from right to left using the marquee tag.
</marquee>

</body>
</html>

Explanation:

In this example, we have created a webpage with a heading and a <marquee> tag that makes the enclosed text scroll from right to left. The behavior attribute defines the scrolling behavior, and the direction attribute specifies the scrolling direction.

Output:

Marquee Example

Global Attributes

The <marquee> tag in HTML supports various global attributes that can be used to modify its behavior. Here are some common global attributes for the <marquee> tag:

  1. id: Specifies a unique id for the element.
  2. class: Assigns one or more class names to the element, which can be used for styling.
  3. style: Defines inline CSS styles for the element.
  4. title: Adds a title to the element, often displayed as a tooltip.
  5. lang: Specifies the language of the element's content.
  6. dir: Sets the text direction, such as "ltr" for left-to-right or "rtl" for right-to-left.

These attributes are part of the global attributes applicable to most HTML elements and can be used with the <marquee> tag for customization and styling.

Specific Attributes

There are some specific attributes that provide control over the appearance and behavior of the <marquee> element.

AttributeValue(s)Description
behaviorscroll, slide, alternateDefines the scrolling behavior of the marquee.
directionleft, right, up, downSets the direction of the scrolling.
scrollamountNumeric valueSpecifies the speed of the scrolling.
scrolldelayNumeric valueDefines the delay between each scroll iteration.
widthNumeric value or percentageSets the width of the marquee.
heightNumeric value or percentageSets the height of the marquee.
loopNumeric value or infiniteSpecifies the number of times the marquee should loop.

Event Attributes

The <marquee> tag in HTML supports various event attributes that allow you to execute JavaScript code in response to specific events. Here are some commonly used event attributes for the <marquee> tag:

  • onstart: <marquee onstart="script">, it defines a script to be run when the marquee starts scrolling.
  • onfinish: <marquee onfinish="script">, it specifies a script to be run when the marquee has finished scrolling.
  • onmouseover: <marquee onmouseover="script">, it defines a script to be run when the mouse pointer is over the marquee.
  • onmouseout: <marquee onmouseout="script">, it specifies a script to be run when the mouse pointer leaves the marquee.

Supported Browsers

The <marquee> tag is supported by most web browsers, but it's considered outdated, and its usage is discouraged. It may not be fully supported in some modern browsers. For better compatibility and adherence to web standards, CSS animations or JavaScript are recommended over the <marquee> tag.

The browsers that are mentioned below still support the <marquee> tag:

  • Chrome
  • Firefox
  • Safari, and 
  • Microsoft Edge 

Advantages and Disadvantages of the HTML Marquee Tag

Advantages of Marquee

1. Grabs User Attention

The marquee tag creates moving text or images, which easily catches the viewer’s eye. It’s useful for highlighting important announcements, promotions, or updates on a webpage without needing complex code.
 

2. Easy to Implement

The <marquee> tag is simple to use and does not require any JavaScript or CSS knowledge. It allows basic animations with just a single HTML tag, making it beginner-friendly.
 

3. Supports Various Directions

You can scroll content in different directions—left, right, up, or down—using simple attributes within the tag. This adds variety to how content is presented visually.
 

4. Compact Display of Information

It helps in displaying long messages or lists within a limited space. Marquees reduce the need for extra screen real estate by showing one piece of information at a time.

Disadvantages of Marquee

1. Deprecated in HTML5

The <marquee> tag is no longer supported in HTML5, as it is considered outdated and non-standard. Modern browsers may reduce support, leading to inconsistent behavior across platforms.
 

2. Poor Accessibility

Screen readers and assistive technologies often struggle to interpret moving text. This can result in a poor experience for visually impaired users and affect your site’s accessibility compliance.
 

3. Negative User Experience

Constantly moving content can be distracting or annoying to users. It may reduce readability and lead to a cluttered user interface, especially when used excessively.
 

4. It lacks Modern Styling Options

Compared to CSS animations, the marquee tag has limited styling flexibility. You cannot easily control speed, pause on hover, or apply transitions, making it less effective for polished UI designs.

Frequently Asked Questions

What is marquee direction?

Marquee direction specifies the direction in which the content within a marquee element scrolls. Common values include "left," "right," "up," and "down." It controls the movement of text or images, enhancing visual dynamics on a webpage.

What is a marquee in HTML with an example?

The <marquee> tag in HTML is used for creating scrolling content. Example: <marquee behavior="scroll">Scrolling Text</marquee>.

Is the marquee still used in HTML?

The <marquee> tag is outdated, and its usage is discouraged in modern web development. CSS is preferred for achieving similar effects.

What is a marquee display?

A marquee display refers to the visual effect of scrolling content, commonly seen in older websites, where text or images move horizontally or vertically.

Conclusion

The marquee tag in HTML offers a glimpse into the early days of web design, showcasing how simple effects were achieved. However, as web design has matured, the marquee tag has been left behind in favor of more robust, accessible, and standards-compliant methods like CSS animations and JavaScript.

Live masterclass