Explore Courses
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Birla Institute of Management Technology Birla Institute of Management Technology Post Graduate Diploma in Management (BIMTECH)
  • 24 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Popular
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science & AI (Executive)
  • 12 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
University of MarylandIIIT BangalorePost Graduate Certificate in Data Science & AI (Executive)
  • 8-8.5 Months
upGradupGradData Science Bootcamp with AI
  • 6 months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
OP Jindal Global UniversityOP Jindal Global UniversityMaster of Design in User Experience Design
  • 12 Months
Popular
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Rushford, GenevaRushford Business SchoolDBA Doctorate in Technology (Computer Science)
  • 36 Months
IIIT BangaloreIIIT BangaloreCloud Computing and DevOps Program (Executive)
  • 8 Months
New
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Popular
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
Golden Gate University Golden Gate University Doctor of Business Administration in Digital Leadership
  • 36 Months
New
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
Popular
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
Bestseller
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
IIIT BangaloreIIIT BangalorePost Graduate Certificate in Machine Learning & Deep Learning (Executive)
  • 8 Months
Bestseller
Jindal Global UniversityJindal Global UniversityMaster of Design in User Experience
  • 12 Months
New
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in AI and Emerging Technologies (Blended Learning Program)
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
ESGCI, ParisESGCI, ParisDoctorate of Business Administration (DBA) from ESGCI, Paris
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration From Golden Gate University, San Francisco
  • 36 Months
Rushford Business SchoolRushford Business SchoolDoctor of Business Administration from Rushford Business School, Switzerland)
  • 36 Months
Edgewood CollegeEdgewood CollegeDoctorate of Business Administration from Edgewood College
  • 24 Months
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with Concentration in Generative AI
  • 36 Months
Golden Gate University Golden Gate University DBA in Digital Leadership from Golden Gate University, San Francisco
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA by Liverpool Business School
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA (Master of Business Administration)
  • 15 Months
Popular
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Business Administration (MBA)
  • 12 Months
New
Deakin Business School and Institute of Management Technology, GhaziabadDeakin Business School and IMT, GhaziabadMBA (Master of Business Administration)
  • 12 Months
Liverpool John Moores UniversityLiverpool John Moores UniversityMS in Data Science
  • 18 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityMaster of Science in Artificial Intelligence and Data Science
  • 12 Months
Bestseller
IIIT BangaloreIIIT BangalorePost Graduate Programme in Data Science (Executive)
  • 12 Months
Bestseller
O.P.Jindal Global UniversityO.P.Jindal Global UniversityO.P.Jindal Global University
  • 12 Months
WoolfWoolfMaster of Science in Computer Science
  • 18 Months
New
Liverpool John Moores University Liverpool John Moores University MS in Machine Learning & AI
  • 18 Months
Popular
Golden Gate UniversityGolden Gate UniversityDBA in Emerging Technologies with concentration in Generative AI
  • 3 Years
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (AI/ML)
  • 36 Months
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDBA Specialisation in AI & ML
  • 36 Months
Golden Gate University Golden Gate University Doctor of Business Administration (DBA)
  • 36 Months
Bestseller
Ecole Supérieure de Gestion et Commerce International ParisEcole Supérieure de Gestion et Commerce International ParisDoctorate of Business Administration (DBA)
  • 36 Months
Rushford, GenevaRushford Business SchoolDoctorate of Business Administration (DBA)
  • 36 Months
Liverpool Business SchoolLiverpool Business SchoolMBA with Marketing Concentration
  • 18 Months
Bestseller
Golden Gate UniversityGolden Gate UniversityMBA with Marketing Concentration
  • 15 Months
Popular
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Corporate & Financial Law
  • 12 Months
Bestseller
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Intellectual Property & Technology Law
  • 12 Months
Jindal Global Law SchoolJindal Global Law SchoolLL.M. in Dispute Resolution
  • 12 Months
IIITBIIITBExecutive Program in Generative AI for Leaders
  • 4 Months
New
IIIT BangaloreIIIT BangaloreExecutive Post Graduate Programme in Machine Learning & AI
  • 13 Months
Bestseller
upGradupGradData Science Bootcamp with AI
  • 6 Months
New
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
KnowledgeHut upGradKnowledgeHut upGradSAFe® 6.0 Certified ScrumMaster (SSM) Training
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutCertified ScrumMaster®(CSM) Training
  • 16 Hours
upGrad KnowledgeHutupGrad KnowledgeHutLeading SAFe® 6.0 Certification
  • 16 Hours
KnowledgeHut upGradKnowledgeHut upGradPMP® certification
  • Self-Paced
upGrad KnowledgeHutupGrad KnowledgeHutAWS Solutions Architect Certification
  • 32 Hours
upGrad KnowledgeHutupGrad KnowledgeHutAzure Administrator Certification (AZ-104)
  • 24 Hours
KnowledgeHut upGradKnowledgeHut upGradAWS Cloud Practioner Essentials Certification
  • 1 Week
KnowledgeHut upGradKnowledgeHut upGradAzure Data Engineering Training (DP-203)
  • 1 Week
MICAMICAAdvanced Certificate in Digital Marketing and Communication
  • 6 Months
Bestseller
MICAMICAAdvanced Certificate in Brand Communication Management
  • 5 Months
Popular
IIM KozhikodeIIM KozhikodeProfessional Certification in HR Management and Analytics
  • 6 Months
Bestseller
Duke CEDuke CEPost Graduate Certificate in Product Management
  • 4-8 Months
Bestseller
Loyola Institute of Business Administration (LIBA)Loyola Institute of Business Administration (LIBA)Executive PG Programme in Human Resource Management
  • 11 Months
Popular
Goa Institute of ManagementGoa Institute of ManagementExecutive PG Program in Healthcare Management
  • 11 Months
IMT GhaziabadIMT GhaziabadAdvanced General Management Program
  • 11 Months
Golden Gate UniversityGolden Gate UniversityProfessional Certificate in Global Business Management
  • 6-8 Months
upGradupGradContract Law Certificate Program
  • Self paced
New
IU, GermanyIU, GermanyMaster of Business Administration (90 ECTS)
  • 18 Months
Bestseller
IU, GermanyIU, GermanyMaster in International Management (120 ECTS)
  • 24 Months
Popular
IU, GermanyIU, GermanyB.Sc. Computer Science (180 ECTS)
  • 36 Months
Clark UniversityClark UniversityMaster of Business Administration
  • 23 Months
New
Golden Gate UniversityGolden Gate UniversityMaster of Business Administration
  • 20 Months
Clark University, USClark University, USMS in Project Management
  • 20 Months
New
Edgewood CollegeEdgewood CollegeMaster of Business Administration
  • 23 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
The American Business SchoolThe American Business SchoolMBA with specialization
  • 23 Months
New
Aivancity ParisAivancity ParisMSc Artificial Intelligence Engineering
  • 24 Months
Aivancity ParisAivancity ParisMSc Data Engineering
  • 24 Months
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGrad KnowledgeHutupGrad KnowledgeHutData Engineer Bootcamp
  • Self-Paced
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
upGradupGradCloud Computing Bootcamp
  • 7.5 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 5 Months
upGrad KnowledgeHutupGrad KnowledgeHutSAFe® 6.0 POPM Certification
  • 16 Hours
upGradupGradDigital Marketing Accelerator Program
  • 05 Months
upGradupGradAdvanced Certificate Program in GenerativeAI
  • 4 Months
New
upGradupGradData Science Bootcamp with AI
  • 6 Months
Popular
upGradupGradFull Stack Software Development Bootcamp
  • 6 Months
Bestseller
upGradupGradUI/UX Bootcamp
  • 3 Months
PwCupGrad CampusCertification Program in Financial Modelling & Analysis in association with PwC India
  • 4 Months
upGradupGradCertificate Course in Business Analytics & Consulting in association with PwC India
  • 06 Months
upGradupGradDigital Marketing Accelerator Program
  • 05 Months

Understanding HTML Marquee Tag Attributes: Key Features and Examples

By upGrad

Updated on Feb 14, 2025 | 19 min read

Share:

The HTML <marquee> tag, once popular for creating scrolling content, has been deprecated in HTML5 due to accessibility issues. However, it remains useful for legacy projects or quick implementations where a simple, lightweight scrolling effect is needed, without the complexity of external libraries.

In this blog, you’ll explore the key features and attributes of the HTML <marquee> tag, its uses in web development, and how it has evolved over time.

What is the HTML Marquee Tag?

The HTML <marquee> tag enables content to move horizontally or vertically across the browser window, providing a simple way to add dynamic movement to your site. However, its limited browser support and accessibility issues make it less suitable for modern development. 

Although deprecated in HTML5, it still offers basic scrolling effects for quick implementations in legacy projects. 

Technical Definition:

<marquee>Content goes here</marquee>

This can be used with various HTML marquee tag attributes to customize the scrolling behavior, including speed, direction, and loop count. 

Example 1: Horizontal Scrolling Text

<marquee direction="left" scrollamount="5">This is a scrolling text from right to left!</marquee>

Output Description: This will create text that continuously scrolls from the right side of the screen to the left. The speed is moderate, as controlled by the scrollamount attribute (set to 5), which adjusts how fast the text moves. 

The text will appear in a horizontal line and will loop indefinitely until it’s either stopped or the page is refreshed. This effect draws attention, making the text stand out as it moves across the screen.

Example 2: Vertical Scrolling Text

<marquee direction="up" height="100px" scrollamount="3">This is vertically scrolling text!</marquee>

Output Description: This will display text that continuously scrolls from the bottom to the top of the specified container (100px in height). The scrollamount="3" controls the speed of the scrolling, making the movement moderate. 

If you don’t define a height, the content might not be visible, as there won't be a set area for the text to scroll within. The height ensures that the text stays within the container's visible region while it moves.

Example 3: Scrolling Image

<marquee direction="left" scrollamount="10"><img src="image.jpg" alt="Scrolling Image"></marquee>

Output Description: This will display an image that moves horizontally from right to left across the screen. The scrollamount="10" controls the speed of the image movement. To ensure responsiveness for mobile-friendly designs, it's important to define a width and height for the image, or use CSS to make the image responsive by setting max-width: 100%;. 

Additionally, providing an alt attribute (as seen in the example) is essential for accessibility as it helps screen readers describe the image content to visually impaired users.

Though modern development favors alternatives like CSS animations, these marquee tag examples demonstrate how simple and quick the <marquee> tag can be for creating basic scrolling effects.

If you want to master modern scrolling effects and dynamic content creation, upGrad’s software development courses offer a thorough curriculum. It covers essential front-end technologies, advanced CSS techniques, and real-world project applications.

Also Read: How to Become a Successful Web Designer: Key Skills, Expert Tips, and Career Insights

Now that you know what the HTML <marquee> tag is and how it works, let's dive into the key HTML marquee tag attributes you can use to control its behavior and customize the scrolling effect to suit your needs.

What Are The Key HTML Marquee Tag Attributes?

The <marquee> tag comes with several attributes that control its behavior and appearance. These attributes allow you to adjust aspects such as the scrolling direction, speed, and looping. 

Below is a list of the key HTML marquee tag attributes, their descriptions, and possible values:

Attribute

Description

Possible Values

Best Practices

direction Defines the direction of the scrolling content. "left", "right", "up", "down" Use horizontal direction (left/right) for text and vertical (up/down) for limited content like announcements. Avoid using excessive vertical scrolling for readability.
behavior Specifies how the content scrolls. "scroll", "slide", "alternate" "scroll" is most common for continuous motion. Use "slide" for one-time movement, and "alternate" for back-and-forth effects. Avoid using too many alternating scrolls, as they can be distracting.
scrollamount Controls the speed of the scrolling content. Numeric value (e.g., 1, 5, 10) Set scrollspeed based on content importance; slower (1-5) for readability and faster (10+) for high-impact content. Avoid setting speeds too high to prevent jarring user experiences.
scrolldelay Sets the delay between each scroll movement. Numeric value (e.g., 0, 50, 100) Use a delay of around 50 for smoother transitions. Avoid values that are too high (e.g., 500) which might make the scroll appear sluggish.
loop Defines how many times the content should scroll. Numeric value (e.g., 1, 2, "infinite") Use "infinite" for continuous content or set a specific number (e.g., 3) to avoid overloading the user. Avoid looping too many times for minor announcements, which may cause annoyance.
bgcolor Sets the background color of the marquee. Color name or HEX code (e.g., "red", "#f00") Choose a background color that contrasts well with the text. Avoid using bright or distracting colors like neon, as they can impact readability.
width Specifies the width of the marquee container. Numeric value (e.g., "300px", "50%") Use relative values (e.g., "50%") for responsiveness in different screen sizes. Avoid fixed pixel widths for mobile-friendly design.
height Specifies the height of the marquee container. Numeric value (e.g., "50px", "100%") Set an appropriate height based on content size to avoid excessive space or clipping. Avoid overly small heights that may cut off text or images.

Also Read: 30+ Best HTML Project Ideas and Topics for Beginners and Professionals in 2025

Directional HTML Marquee Tag Attributes

The direction attribute controls the scrolling direction of the content in the <marquee> tag. You can adjust this to make text or images scroll in various directions. 

However, it's important to note that browser behavior may vary, especially with older or less common browsers, and certain direction settings may not display correctly. 

Developers should test across different browsers and use CSS-based solutions, such as CSS animations, for more consistent and cross-browser behavior.

1. Scroll Left

<marquee direction="left">This text scrolls to the left!</marquee>

Output: Text will scroll from right to left across the page. The scrolling effect is continuous, moving across the screen in a smooth flow.

Use Case: This is commonly used for displaying news tickers or breaking news on websites, where quick, attention-grabbing text is needed to keep visitors informed.

2. Scroll Right

<marquee direction="right">This text scrolls to the right!</marquee>

Output: Text will scroll from left to right, moving horizontally across the screen in the opposite direction of the default behavior.

Use Case: Useful for highlighting announcements or displaying special offers that need to be emphasized but in the opposite direction for visual contrast on websites.

3. Scroll Up

<marquee direction="up" height="100px">This text scrolls upwards!</marquee>

Output: Text will scroll from the bottom to the top within the specified container (in this case, 100px in height). It moves vertically, providing a distinct, attention-grabbing effect.

Use Case: Ideal for displaying live scores in sports websites, chat feeds, or social media updates, where information flows upwards to give space for new content.

4. Scroll Down

<marquee direction="down" height="100px">This text scrolls downwards!</marquee>

Output: Text will scroll from the top to the bottom within the specified container (here, 100px height). This provides a flowing effect from top to bottom.

Use Case: Perfect for notification banners or welcome messages on homepages, where the information flows down to catch the user’s attention.

5. Scrolling Speed

<marquee direction="left" scrollamount="10">This text moves quickly!</marquee>

Output: The speed of the scrolling text is controlled by the scrollamount attribute. A higher value (like 10) results in faster scrolling, whereas lower values (like 1) slow down the movement.

Use Case: This can be used for highlighting urgent information, such as limited-time offers, where speed is important to grab the user's attention quickly.

Also Read: Structure of HTML: The Essential Guide to Building Web Pages in 2025

Modifying and Formatting Marquee Tags

You can modify and style the content within a <marquee> tag to improve its appearance and functionality.

1. Making Marquee Content Editable

<marquee direction="left" contenteditable="true">You can edit this scrolling text!</marquee>

Output: The content of the scrolling text can be directly edited by the user, allowing for dynamic changes in real-time.

Use Case: This can be useful for interactive websites or feedback banners, where users might want to edit or customize messages, such as in forum posts or editable event banners.

2. Styling the Marquee with CSS

<marquee direction="left" style="color: red; font-size: 20px;">Stylized scrolling text!</marquee>

Output: The marquee text is styled using CSS, changing the color to red and increasing the font size to 20px, making it more noticeable.

Use Case: This is ideal for an announcement banner on a website, where a prominent, eye-catching message is needed, such as "Flash Sale: 50% off today only!". The styling makes it stand out against other content, grabbing user attention quickly.

Methods and Event Handlers for <marquee>

The <marquee> tag supports methods and event handlers that can help control its behavior and create interactive effects.

1. Controlling Marquee Behavior with Methods

  • start()
<marquee id="myMarquee">Start this scrolling text.</marquee>
<script>
  document.getElementById("myMarquee").start();
</script>

Output: The start() method initiates the scrolling animation of the <marquee> tag, causing the text to begin moving across the screen.

Use Case: This method can be useful in interactive UI elements like image carousels or announcements, where the scrolling starts based on user interaction. For example, you could trigger the scroll when a user clicks a "Start" button.

  • stop()
<marquee id="myMarquee">Stop this scrolling text.</marquee>
<script>
  document.getElementById("myMarquee").stop();
</script>

Output: The stop() method halts the scrolling animation of the <marquee> tag, pausing the text where it is.

Use Case: This is useful when you want the user to have control over the scrolling content, such as pausing scrolling when hovering over a call-to-action or a special announcement banner. For example, stopping scrolling on hover gives users the chance to read the content clearly.

2. Handling Events for Interactive Marquee Effects

  • onbounce
<marquee onbounce="alert('The marquee bounced!')">This text bounces when it reaches the end.</marquee>

Output: This triggers an alert when the marquee bounces back after reaching the end of the container.

Use Case: The onbounce event is perfect for situations where you want to notify users that the scrolling text has finished its loop and is about to reverse direction. For example, this can be useful in advertising banners where you want to engage the user with notifications upon each bounce or completion.

  • onfinish
<marquee onfinish="alert('The scrolling has finished!')">This text triggers an event when scrolling ends.</marquee>

Output: An alert appears when the scrolling completes its full animation cycle.

Use Case: The onfinish event can be used when you want to trigger an action after the marquee has completed its scroll. For instance, this can be helpful in tutorials or announcement banners where you want to direct users to another page or prompt them for additional interaction after the scroll finishes.

  • onstart
<marquee onstart="alert('The marquee has started!')">This text triggers an event when scrolling starts.</marquee>

Output: An alert appears when the scrolling begins, indicating the start of the animation.

Use Case: The onstart event is useful when you want to confirm that the scrolling animation has started. It can be used in interactive tutorials or user notifications, where users are informed that the scrolling content is now active and ready for viewing.

By using these methods and events, you can create more interactive and engaging scrolling effects with the <marquee> tag.

Also Read: 27 Innovative HTML Project Ideas for Beginners in 2025: Source Code, Benefits, and More

Now that you’re familiar with the key HTML marquee tag attributes, let’s dive into some practical marquee tag examples to show how you can apply them in real-world scenarios.

Practical Marquee Tag Examples and Real-World Use Cases

The <marquee> tag, though outdated, is useful for quick, simple scrolling effects like news tickers, promotional banners, and real-time alerts. However, it poses accessibility issues, especially for users with motion sensitivity and visual impairments.

For better accessibility, consider using ARIA roles (e.g., aria-live="polite") and CSS animations to create smoother, more customizable scroll effects that accommodate all users.

Let’s explore how developers can apply the <marquee> tag in projects like e-commerce sites, event announcements, and social media feeds to deliver dynamic content efficiently.

Practical Marquee Tag Examples

The <marquee> tag provides a quick solution for adding scrolling content to webpages. It’s ideal for use cases like news tickers, promotional banners, and real-time alerts, offering a simple way to grab attention with minimal code. 

Here are some common use cases where the <marquee> tag can be applied:

1. Scrolling News Tickers

A scrolling news ticker can display breaking news or important updates in a small, dynamic space. The marquee tag is perfect for this quick, continuous scrolling effect.

<marquee direction="left" scrollamount="5">Breaking News: Major earthquake hits the city center!</marquee>

Output: This text will scroll from right to left at a moderate speed, showcasing important news or updates in a compact area. The scrollamount="5" defines the speed of the scrolling text, and the direction="left" ensures it moves from right to left.

Use Case: Ideal for news websites that need to keep visitors informed with live updates or breaking news without taking up too much space.

2. Featured Products Carousel

Online stores can use the marquee tag to showcase featured products or special offers in a continuously scrolling banner.

<marquee direction="left" scrollamount="10">
  <img src="product1.jpg" alt="Featured Product 1"> 
  <img src="product2.jpg" alt="Featured Product 2">
</marquee>

Output: Images will scroll from left to right, showcasing featured products or promotional items. The scrolling speed is set to scrollamount="10", making it faster than the previous example.

Use Case: Perfect for e-commerce websites looking to draw attention to new arrivals or ongoing promotions in a compact, moving display.

3. Interactive Quotes Display

You can use the marquee tag to create a scrolling display of inspirational or customer testimonial quotes.

<marquee direction="up" height="100px" scrollamount="3">
  "Great service!" - John Doe<br>
  "I love this product!" - Jane Smith
</marquee>

Output: The quotes scroll upwards within a confined space of 100px height, allowing customer testimonials or inspirational quotes to move dynamically. The scrollamount="3" controls the speed of the scrolling.

Use Case: A good option for blogs, personal websites, or customer service pages to keep visitors engaged with positive feedback or motivational quotes.

4. Weather Forecast Scroller

The marquee tag can be used to create a scrolling weather forecast for a location, displaying temperature, weather conditions, and other real-time updates.

<marquee direction="left" scrollamount="5">Weather Update: 72°F, Sunny | Tomorrow: 68°F, Cloudy</marquee>

Output: This will create a horizontally scrolling weather forecast, displaying real-time weather updates and predictions. The text scrolls from right to left with a moderate speed set by scrollamount="5".

Use Case: Useful on news, travel, or weather websites where real-time weather information is important for users.

Also Read: HTML Vs XML: Difference Between HTML and XML

Real-World Applications of Marquee Tag in HTML

Although the <marquee> tag is considered outdated, it still has its place in some real-world applications. Below are some examples where this tag can be effectively utilized:

1. Event Announcements and Alerts

The marquee tag is commonly used for displaying important announcements or alerts at the top or bottom of a page, ensuring that users don’t miss crucial information.

<marquee direction="left" bgcolor="yellow" scrollamount="6">
  Attention: Scheduled maintenance will occur on Saturday, 12 PM - 2 PM.
</marquee>

Output: The message will scroll from left to right with a bright yellow background, drawing attention to the scheduled maintenance alert. The scrollamount="6" adjusts the speed for a more moderate pace.

Use Case: Ideal for corporate websites, tech platforms, or service providers needing to notify users about system updates or upcoming events.

2. Interactive User Engagement Features

The marquee can be used interactively for engaging with users, such as displaying real-time updates or user-generated content.

<marquee direction="right" scrollamount="5" onstart="alert('The marquee has started!')">
  Welcome to our website! Enjoy your stay.
</marquee>

Output: When the marquee starts, it triggers an alert saying "The marquee has started!" The text will scroll from left to right with a speed of scrollamount="5".

Use Case: Can be used for creating a welcoming, interactive feature on homepage banners or announcements, enhancing user experience through movement and interaction.

3. Promotional Banners and Advertisements

E-commerce sites or businesses can use the marquee tag to display promotional offers, sales announcements, or rotating advertisements.

<marquee direction="left" bgcolor="green" scrollamount="8">
  50% off this weekend only! Shop now!
</marquee>

Output: This scrolling banner displays a promotional message in a bright green color, moving from left to right at a fast pace (scrollamount="8").

Use Case: Effective for online retailers, small businesses, or marketing campaigns that need to highlight discounts, limited-time offers, or important brand messages.

4. Creative Design Elements in Websites

Web designers can use the marquee tag for creating fun, creative animations, making the site feel dynamic and visually interesting.

<marquee direction="right" scrollamount="4" style=" font-size: 20px;">
  Welcome to our creative website, where every pixel moves!
</marquee>

Output: The text scrolls from left to right, using a custom font (Arial) and a font size of 20px. It moves at a moderate speed (scrollamount="4").

Use Case: This could be used in personal portfolios, creative agencies, or design websites where a playful, eye-catching design adds to the user experience.

While alternatives such as CSS animations and JavaScript libraries offer more control and flexibility, the marquee tag provides an easy, quick solution for adding movement and engagement to your site.

You can dive deeper into this subject with upGrad’s free JavaScript Basics course. Gain a solid foundation in JavaScript and start building dynamic, interactive websites today. Sign up now and begin learning at your own pace.

Also Read: Top 26+ Web Designing Projects for Beginners in 2025: Tools & Tips

While the <marquee> tag is useful for simple scrolling effects, there are modern alternatives that give you more control and customization for better performance.

Modern Alternatives to the Marquee Tag in HTML

While the <marquee> tag is considered outdated, modern web development provides more powerful and flexible alternatives to achieve scrolling text effects. These methods offer better performance, greater customization, and broader compatibility across contemporary browsers. 

Let’s explore some of the most effective alternatives that have replaced the <marquee> tag, with examples and explanations:

1. Using CSS Animations for Scrolling Effects

CSS animations allow developers to create smooth and customizable scrolling effects without relying on deprecated HTML tags. Using @keyframes, you can control the scrolling direction, speed, and easing for a more refined effect.

 @keyframes scrollText {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.scrolling-text {
  white-space: nowrap;
  animation: scrollText 10s linear infinite;
}

Output: Text will move from right to left across the screen continuously, with the speed set to 10 seconds for the full animation cycle. The linear timing function ensures a constant speed, and the infinite keyword makes it loop indefinitely.

Explanation: This solution allows for great flexibility. You can easily change the direction by modifying translateX to translateY, and adjust the speed and timing by modifying the animation properties.

2. Implementing JavaScript/jQuery Scrollers

JavaScript and jQuery offer greater control over scrolling behaviors and allow for interactive features. jQuery plugins like jquery.marquee.js provide an easy-to-implement solution for more dynamic scrolling effects.

<div id="scrollingText">This text scrolls smoothly using jQuery.</div>
<script>
  $('#scrollingText').marquee({duration: 5000, gap: 50});
</script>

Output: This jQuery solution will create a smooth scroll for the text within the #scrollingText container, with the text moving horizontally. The speed (duration) is set to 5 seconds, and the gap between each scroll cycle is set to 50 pixels.

Explanation: jQuery provides an easy way to control more complex aspects of scrolling, such as the timing, gap, direction, and more. It also enables you to add interactive events like pausing on hover or starting/stopping the scroll dynamically.

3. Leveraging CSS Scroll Snap for Smooth Scrolling

CSS Scroll Snap enables smooth, predictable scrolling behavior for horizontally or vertically scrollable elements. It’s ideal for implementing carousel-like functionality or other elements that require controlled scrolling.

 .scroll-container {
  scroll-snap-type: x mandatory;
  overflow-x: scroll;
  width: 100%;
}

.scroll-item {
  scroll-snap-align: start;
  width: 300px;
}

Output: The container will allow horizontal scrolling, but each item will "snap" into place at the start of the scroll container. As users scroll through items, the content will align to the edge of the container smoothly.

Explanation: CSS Scroll Snap ensures a consistent experience for users by automatically aligning scroll items. This is especially useful for building galleries, carousels, or any scrollable list where elements should snap into view rather than scrolling arbitrarily.

4. Exploring the CSS Marquee Module

The CSS Marquee Module is an official, standards-based approach to replicate the functionality of the <marquee> tag using CSS. It’s still experimental but provides more control, accessibility, and better integration with modern web standards.

 .marquee {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  animation: marquee 10s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

Output: This CSS code mimics the marquee behavior by moving the content from right to left. The animation runs infinitely, similar to the traditional <marquee> tag.

Explanation: Using the CSS Marquee Module, developers can create the same scrolling effect as the <marquee> tag but with better control over performance and design. Since it’s based on CSS, it integrates smoothly with the rest of the page's layout and styling.

5. Utilizing External Libraries like GSAP

The GreenSock Animation Platform (GSAP) is a robust JavaScript library for high-performance animations. It’s commonly used for complex and interactive scrolling effects, giving developers fine-grained control over the animation behavior.

gsap.to(".scrolling-text", { x: "-100%", duration: 10, repeat: -1, ease: "linear" });

Output: The text with the class .scrolling-text will scroll horizontally across the screen with a duration of 10 seconds, repeating indefinitely with a constant speed.

Explanation: GSAP offers powerful tools for advanced animations, allowing precise control over speed, easing, and repeat behavior. It's a go-to solution for developers working on high-performance, interactive web applications where fine-tuned animations are required.

Here’s a table comparing the performance, flexibility, and browser support of the <marquee> tag, CSS animations, and JavaScript for scrolling effects:

Method

Speed

Flexibility

Browser Support

Tag Fast, but limited in customization. Very limited, mainly for basic scrolling. Deprecated in HTML5, inconsistent support across browsers, especially with direction changes.
CSS Animations Smooth, can be fine-tuned for performance. Highly flexible, supports various types of animations. Wide support in modern browsers (Chrome, Firefox, Edge). Older browsers may need prefixes.
JavaScript Can be optimized for performance, but requires more code. Extremely flexible, allows for complex and interactive animations. Supported in all browsers, but may require external libraries for smoother performance.

Whether you choose CSS animations, JavaScript libraries, or CSS Scroll Snap, these techniques offer a far better user experience than the old <marquee> tag, ensuring cross-browser compatibility and responsive web design.

Also Read: Career in Web Designing: Everything You Should Know

If you want to take these techniques further, upGrad gives you the skills to create dynamic websites using the latest tools and technologies.

How Can upGrad Accelerate Your Full Stack Development Learning Journey?

upGrad, South Asia’s leading EdTech platform, offers specialized courses in Full Stack Development that cover essential skills for building dynamic and scalable web applications. These courses provide a comprehensive curriculum, from front-end technologies like HTML, CSS, and JavaScript to back-end frameworks like Node.js and databases like MongoDB.

With over 10M+ learners trained, upGrad equips individuals with technical expertise, hands-on projects, and real-world application experience.

Here are some relevant courses to enhance your learning journey:

You can also get personalized career counseling with upGrad to guide your career path, or visit your nearest upGrad center and start hands-on training today!

Boost your career with our popular Software Engineering courses, offering hands-on training and expert guidance to turn you into a skilled software developer.

Master in-demand Software Development skills like coding, system design, DevOps, and agile methodologies to excel in today’s competitive tech industry.

Stay informed with our widely-read Software Development articles, covering everything from coding techniques to the latest advancements in software engineering.

Frequently Asked Questions

1. Is the <marquee> tag still supported by modern browsers?

2. Can I customize the speed of the scrolling text in a <marquee> tag?

3. How do I make the scrolling content pause when hovered?

4. Does the <marquee> tag work with images as well?

5. How can I create a vertical scrolling marquee?

6. What are the accessibility issues with using the <marquee> tag?

7. Can I add multiple items within a single marquee tag?

8. Is there a way to make the marquee content loop a certain number of times?

9. How do I apply a background color to the marquee text?

10. Can I change the direction of the scroll mid-animation?

11. What are some alternatives to the <marquee> tag for dynamic scrolling effects?

upGrad

481 articles published

Get Free Consultation

+91

By submitting, I accept the T&C and
Privacy Policy

India’s #1 Tech University

Executive PG Certification in AI-Powered Full Stack Development

77%

seats filled

View Program

Top Resources

Recommended Programs

Suggested Blogs