Marquee Tag in HTML Example Tutorial With Code Snippets

The marquee tag in HTML is an obsolete element that was used to create text that moves across the screen in a specified direction. Despite being deprecated in HTML4 and removed in HTML5, it's still worth understanding for historical purposes and to help you handle any legacy code you might encounter.

The Greatest Infinite Marquee (HTML + CSS only) - Webflow
The Greatest Infinite Marquee (HTML + CSS only) - Webflow

HTML offers a wide range of tags to make web pages interactive and engaging. One of the oldest methods of creating animation was the marquee tag. Here's an example of how you might use the marquee tag:

Marquee tag attributes
Marquee tag attributes

Basic Marquee Usage

The marquee tag accepts several attributes, but the most common ones are behavior, direction, and scrollamount. Behavior can be either 'scroll' or 'slide'. 'Scroll' creates a continuous, looping motion (left to right), while 'slide' makes the text slide in the specified direction and stop at the end. Direction can be 'left', 'right', 'up', or 'down'. Scrollamount dictates the speed at which the text moves.

Marquee in CSS - Beginner's Guide
Marquee in CSS - Beginner's Guide

Here's a simple example: <marquee behavior="scroll" direction="left">This text will scroll left</marquee>

Creating Loops with Marquee

Quick HTML Tags Cheat Sheet
Quick HTML Tags Cheat Sheet

To make the marquee text loop back to the beginning, you can use the loop attribute. Setting loop="infinite" will make the text continuously move back and forth.

Example: <marquee behavior="slide" direction="right" loop="infinite">This text will slide right and loop</marquee>

Controlling Scroll Speed and Aligning Text

HTML TAG
HTML TAG

The scrollamount attribute controls the speed of the marquee. High values mean faster scrolling. The align attribute, used similarly to the align attribute in table cells, can align the marquee text within its container.

Example: <marquee behavior="scroll" direction="up" scrollamount="10" align="center">This text will scroll up fast and center align</marquee>

Alternatives to Marquee

๐™ƒ๐™๐™ˆ๐™‡ ๐™๐™–๐™œ๐™จ ๐™˜๐™๐™š๐™–๐™ฉ ๐™จ๐™๐™š๐™š๐™ฉ
๐™ƒ๐™๐™ˆ๐™‡ ๐™๐™–๐™œ๐™จ ๐™˜๐™๐™š๐™–๐™ฉ ๐™จ๐™๐™š๐™š๐™ฉ

The marquee tag is non-standard and unsupported in modern browsers. It's recommended to use CSS animations or JavaScript libraries for creating animations. However, it's useful to understand the marquee tag for historical reasons and to interpret old web pages.

For a more interactive and dynamic web experience, using JavaScript libraries such as GSAP or jQuery is more suitable. They not only provide complex animation capabilities but also work in modern browsers and have wide community support.

About HTML tags
About HTML tags
What are HTML Tags? List of common HTML Tags
What are HTML Tags? List of common HTML Tags
HTML Heading Tag Example
HTML Heading Tag Example
the ultimate guide to creating and formating tags
the ultimate guide to creating and formating tags
Commonly Used HTML Tags with Examples - DataFlair
Commonly Used HTML Tags with Examples - DataFlair
887 reactions ยท 135 shares | HTML5 Tags information 2026. #coding #webdevelopmentโœจ #htmlcssjavascript #programming | Premi Coding | Facebook
887 reactions ยท 135 shares | HTML5 Tags information 2026. #coding #webdevelopmentโœจ #htmlcssjavascript #programming | Premi Coding | Facebook
marquee tag in html - เฎคเฎฎเฎฟเฎดเฎฟเฎฒเฏ (html tags) #shorts
marquee tag in html - เฎคเฎฎเฎฟเฎดเฎฟเฎฒเฏ (html tags) #shorts
HTML Tags โ€” List of all HTML Tags with Examples TutorialBrain
HTML Tags โ€” List of all HTML Tags with Examples TutorialBrain
List of HTML Tags
List of HTML Tags
Types of tags in HTML
Types of tags in HTML
making html easy for you guysss
making html easy for you guysss
HTML TAGS
HTML TAGS
Etiqueta Marquee HTML
Etiqueta Marquee HTML
Harnessing the Power of the <img> Tag in HTML
Harnessing the Power of the <img> Tag in HTML
Marquee in CSS - Beginner's Guide
Marquee in CSS - Beginner's Guide
a close look at tags info sheet
a close look at tags info sheet
How do I put text on a slider image in HTML?
How do I put text on a slider image in HTML?
Title: HTML Semantic vs Non-Semantic Tags โ€“ Guide by RajNandani
Title: HTML Semantic vs Non-Semantic Tags โ€“ Guide by RajNandani
HTML TAGS | PART 1
HTML TAGS | PART 1
the basic html tag list is displayed in this screenshote screen graber, which shows
the basic html tag list is displayed in this screenshote screen graber, which shows

Marquee might have been outdated, but its usage has made a significant impact on web development history. Understanding its usage provides insights into the evolution of web technologies. Now that you've learned about the marquee tag, continue exploring HTML tags for more engaging web development.

Related Articles

Html For Dummies Pdf Free Html Table Tutorialspoint Div Tag Examples Html List Tutorialspoint Image Tag In Coding Html Tutorial Myanmar Tutorialspoint Html Pdf Explain Table In Html With Example Htmlunit Java Tutorial Html Javascript Routing