- Blog Categories
- Software Development
- Data Science
- AI/ML
- Marketing
- General
- MBA
- Management
- Legal
- Software Development Projects and Ideas
- 12 Computer Science Project Ideas
- 28 Beginner Software Projects
- Top 10 Engineering Project Ideas
- Top 10 Easy Final Year Projects
- Top 10 Mini Projects for Engineers
- 25 Best Django Project Ideas
- Top 20 MERN Stack Project Ideas
- Top 12 Real Time Projects
- Top 6 Major CSE Projects
- 12 Robotics Projects for All Levels
- Java Programming Concepts
- Abstract Class in Java and Methods
- Constructor Overloading in Java
- StringBuffer vs StringBuilder
- Java Identifiers: Syntax & Examples
- Types of Variables in Java Explained
- Composition in Java: Examples
- Append in Java: Implementation
- Loose Coupling vs Tight Coupling
- Integrity Constraints in DBMS
- Different Types of Operators Explained
- Career and Interview Preparation in IT
- Top 14 IT Courses for Jobs
- Top 20 Highest Paying Languages
- 23 Top CS Interview Q&A
- Best IT Jobs without Coding
- Software Engineer Salary in India
- 44 Agile Methodology Interview Q&A
- 10 Software Engineering Challenges
- Top 15 Tech's Daily Life Impact
- 10 Best Backends for React
- Cloud Computing Reference Models
- Web Development and Security
- Find Installed NPM Version
- Install Specific NPM Package Version
- Make API Calls in Angular
- Install Bootstrap in Angular
- Use Axios in React: Guide
- StrictMode in React: Usage
- 75 Cyber Security Research Topics
- Top 7 Languages for Ethical Hacking
- Top 20 Docker Commands
- Advantages of OOP
- Data Science Projects and Applications
- 42 Python Project Ideas for Beginners
- 13 Data Science Project Ideas
- 13 Data Structure Project Ideas
- 12 Real-World Python Applications
- Python Banking Project
- Data Science Course Eligibility
- Association Rule Mining Overview
- Cluster Analysis in Data Mining
- Classification in Data Mining
- KDD Process in Data Mining
- Data Structures and Algorithms
- Binary Tree Types Explained
- Binary Search Algorithm
- Sorting in Data Structure
- Binary Tree in Data Structure
- Binary Tree vs Binary Search Tree
- Recursion in Data Structure
- Data Structure Search Methods: Explained
- Binary Tree Interview Q&A
- Linear vs Binary Search
- Priority Queue Overview
- Python Programming and Tools
- Top 30 Python Pattern Programs
- List vs Tuple
- Python Free Online Course
- Method Overriding in Python
- Top 21 Python Developer Skills
- Reverse a Number in Python
- Switch Case Functions in Python
- Info Retrieval System Overview
- Reverse a Number in Python
- Real-World Python Applications
- Data Science Careers and Comparisons
- Data Analyst Salary in India
- Data Scientist Salary in India
- Free Excel Certification Course
- Actuary Salary in India
- Data Analyst Interview Guide
- Pandas Interview Guide
- Tableau Filters Explained
- Data Mining Techniques Overview
- Data Analytics Lifecycle Phases
- Data Science Vs Analytics Comparison
- Artificial Intelligence and Machine Learning Projects
- Exciting IoT Project Ideas
- 16 Exciting AI Project Ideas
- 45+ Interesting ML Project Ideas
- Exciting Deep Learning Projects
- 12 Intriguing Linear Regression Projects
- 13 Neural Network Projects
- 5 Exciting Image Processing Projects
- Top 8 Thrilling AWS Projects
- 12 Engaging AI Projects in Python
- NLP Projects for Beginners
- Concepts and Algorithms in AIML
- Basic CNN Architecture Explained
- 6 Types of Regression Models
- Data Preprocessing Steps
- Bagging vs Boosting in ML
- Multinomial Naive Bayes Overview
- Bayesian Network Example
- Bayes Theorem Guide
- Top 10 Dimensionality Reduction Techniques
- Neural Network Step-by-Step Guide
- Technical Guides and Comparisons
- Make a Chatbot in Python
- Compute Square Roots in Python
- Permutation vs Combination
- Image Segmentation Techniques
- Generative AI vs Traditional AI
- AI vs Human Intelligence
- Random Forest vs Decision Tree
- Neural Network Overview
- Perceptron Learning Algorithm
- Selection Sort Algorithm
- Career and Practical Applications in AIML
- AI Salary in India Overview
- Biological Neural Network Basics
- Top 10 AI Challenges
- Production System in AI
- Top 8 Raspberry Pi Alternatives
- Top 8 Open Source Projects
- 14 Raspberry Pi Project Ideas
- 15 MATLAB Project Ideas
- Top 10 Python NLP Libraries
- Naive Bayes Explained
- Digital Marketing Projects and Strategies
- 10 Best Digital Marketing Projects
- 17 Fun Social Media Projects
- Top 6 SEO Project Ideas
- Digital Marketing Case Studies
- Coca-Cola Marketing Strategy
- Nestle Marketing Strategy Analysis
- Zomato Marketing Strategy
- Monetize Instagram Guide
- Become a Successful Instagram Influencer
- 8 Best Lead Generation Techniques
- Digital Marketing Careers and Salaries
- Digital Marketing Salary in India
- Top 10 Highest Paying Marketing Jobs
- Highest Paying Digital Marketing Jobs
- SEO Salary in India
- Content Writer Salary Guide
- Digital Marketing Executive Roles
- Career in Digital Marketing Guide
- Future of Digital Marketing
- MBA in Digital Marketing Overview
- Digital Marketing Techniques and Channels
- 9 Types of Digital Marketing Channels
- Top 10 Benefits of Marketing Branding
- 100 Best YouTube Channel Ideas
- YouTube Earnings in India
- 7 Reasons to Study Digital Marketing
- Top 10 Digital Marketing Objectives
- 10 Best Digital Marketing Blogs
- Top 5 Industries Using Digital Marketing
- Growth of Digital Marketing in India
- Top Career Options in Marketing
- Interview Preparation and Skills
- 73 Google Analytics Interview Q&A
- 56 Social Media Marketing Q&A
- 78 Google AdWords Interview Q&A
- Top 133 SEO Interview Q&A
- 27+ Digital Marketing Q&A
- Digital Marketing Free Course
- Top 9 Skills for PPC Analysts
- Movies with Successful Social Media Campaigns
- Marketing Communication Steps
- Top 10 Reasons to Be an Affiliate Marketer
- Career Options and Paths
- Top 25 Highest Paying Jobs India
- Top 25 Highest Paying Jobs World
- Top 10 Highest Paid Commerce Job
- Career Options After 12th Arts
- Top 7 Commerce Courses Without Maths
- Top 7 Career Options After PCB
- Best Career Options for Commerce
- Career Options After 12th CS
- Top 10 Career Options After 10th
- 8 Best Career Options After BA
- Projects and Academic Pursuits
- 17 Exciting Final Year Projects
- Top 12 Commerce Project Topics
- Top 13 BCA Project Ideas
- Career Options After 12th Science
- Top 15 CS Jobs in India
- 12 Best Career Options After M.Com
- 9 Best Career Options After B.Sc
- 7 Best Career Options After BCA
- 22 Best Career Options After MCA
- 16 Top Career Options After CE
- Courses and Certifications
- 10 Best Job-Oriented Courses
- Best Online Computer Courses
- Top 15 Trending Online Courses
- Top 19 High Salary Certificate Courses
- 21 Best Programming Courses for Jobs
- What is SGPA? Convert to CGPA
- GPA to Percentage Calculator
- Highest Salary Engineering Stream
- 15 Top Career Options After Engineering
- 6 Top Career Options After BBA
- Job Market and Interview Preparation
- Why Should You Be Hired: 5 Answers
- Top 10 Future Career Options
- Top 15 Highest Paid IT Jobs India
- 5 Common Guesstimate Interview Q&A
- Average CEO Salary: Top Paid CEOs
- Career Options in Political Science
- Top 15 Highest Paying Non-IT Jobs
- Cover Letter Examples for Jobs
- Top 5 Highest Paying Freelance Jobs
- Top 10 Highest Paying Companies India
- Career Options and Paths After MBA
- 20 Best Careers After B.Com
- Career Options After MBA Marketing
- Top 14 Careers After MBA In HR
- Top 10 Highest Paying HR Jobs India
- How to Become an Investment Banker
- Career Options After MBA - High Paying
- Scope of MBA in Operations Management
- Best MBA for Working Professionals India
- MBA After BA - Is It Right For You?
- Best Online MBA Courses India
- MBA Project Ideas and Topics
- 11 Exciting MBA HR Project Ideas
- Top 15 MBA Project Ideas
- 18 Exciting MBA Marketing Projects
- MBA Project Ideas: Consumer Behavior
- What is Brand Management?
- What is Holistic Marketing?
- What is Green Marketing?
- Intro to Organizational Behavior Model
- Tech Skills Every MBA Should Learn
- Most Demanding Short Term Courses MBA
- MBA Salary, Resume, and Skills
- MBA Salary in India
- HR Salary in India
- Investment Banker Salary India
- MBA Resume Samples
- Sample SOP for MBA
- Sample SOP for Internship
- 7 Ways MBA Helps Your Career
- Must-have Skills in Sales Career
- 8 Skills MBA Helps You Improve
- Top 20+ SAP FICO Interview Q&A
- MBA Specializations and Comparative Guides
- Why MBA After B.Tech? 5 Reasons
- How to Answer 'Why MBA After Engineering?'
- Why MBA in Finance
- MBA After BSc: 10 Reasons
- Which MBA Specialization to choose?
- Top 10 MBA Specializations
- MBA vs Masters: Which to Choose?
- Benefits of MBA After CA
- 5 Steps to Management Consultant
- 37 Must-Read HR Interview Q&A
- Fundamentals and Theories of Management
- What is Management? Objectives & Functions
- Nature and Scope of Management
- Decision Making in Management
- Management Process: Definition & Functions
- Importance of Management
- What are Motivation Theories?
- Tools of Financial Statement Analysis
- Negotiation Skills: Definition & Benefits
- Career Development in HRM
- Top 20 Must-Have HRM Policies
- Project and Supply Chain Management
- Top 20 Project Management Case Studies
- 10 Innovative Supply Chain Projects
- Latest Management Project Topics
- 10 Project Management Project Ideas
- 6 Types of Supply Chain Models
- Top 10 Advantages of SCM
- Top 10 Supply Chain Books
- What is Project Description?
- Top 10 Project Management Companies
- Best Project Management Courses Online
- Salaries and Career Paths in Management
- Project Manager Salary in India
- Average Product Manager Salary India
- Supply Chain Management Salary India
- Salary After BBA in India
- PGDM Salary in India
- Top 7 Career Options in Management
- CSPO Certification Cost
- Why Choose Product Management?
- Product Management in Pharma
- Product Design in Operations Management
- Industry-Specific Management and Case Studies
- Amazon Business Case Study
- Service Delivery Manager Job
- Product Management Examples
- Product Management in Automobiles
- Product Management in Banking
- Sample SOP for Business Management
- Video Game Design Components
- Top 5 Business Courses India
- Free Management Online Course
- SCM Interview Q&A
- Fundamentals and Types of Law
- Acceptance in Contract Law
- Offer in Contract Law
- 9 Types of Evidence
- Types of Law in India
- Introduction to Contract Law
- Negotiable Instrument Act
- Corporate Tax Basics
- Intellectual Property Law
- Workmen Compensation Explained
- Lawyer vs Advocate Difference
- Law Education and Courses
- LLM Subjects & Syllabus
- Corporate Law Subjects
- LLM Course Duration
- Top 10 Online LLM Courses
- Online LLM Degree
- Step-by-Step Guide to Studying Law
- Top 5 Law Books to Read
- Why Legal Studies?
- Pursuing a Career in Law
- How to Become Lawyer in India
- Career Options and Salaries in Law
- Career Options in Law India
- Corporate Lawyer Salary India
- How To Become a Corporate Lawyer
- Career in Law: Starting, Salary
- Career Opportunities: Corporate Law
- Business Lawyer: Role & Salary Info
- Average Lawyer Salary India
- Top Career Options for Lawyers
- Types of Lawyers in India
- Steps to Become SC Lawyer in India
- Tutorials
- Software Tutorials
- C Tutorials
- Recursion in C: Fibonacci Series
- Checking String Palindromes in C
- Prime Number Program in C
- Implementing Square Root in C
- Matrix Multiplication in C
- Understanding Double Data Type
- Factorial of a Number in C
- Structure of a C Program
- Building a Calculator Program in C
- Compiling C Programs on Linux
- Java Tutorials
- Handling String Input in Java
- Determining Even and Odd Numbers
- Prime Number Checker
- Sorting a String
- User-Defined Exceptions
- Understanding the Thread Life Cycle
- Swapping Two Numbers
- Using Final Classes
- Area of a Triangle
- Skills
- Explore Skills
- Management Skills
- Software Engineering
- JavaScript
- Data Structure
- React.js
- Core Java
- Node.js
- Blockchain
- SQL
- Full stack development
- Devops
- NFT
- BigData
- Cyber Security
- Cloud Computing
- Database Design with MySQL
- Cryptocurrency
- Python
- Digital Marketings
- Advertising
- Influencer Marketing
- Performance Marketing
- Search Engine Marketing
- Email Marketing
- Content Marketing
- Social Media Marketing
- Display Advertising
- Marketing Analytics
- Web Analytics
- Affiliate Marketing
- MBA
- MBA in Finance
- MBA in HR
- MBA in Marketing
- MBA in Business Analytics
- MBA in Operations Management
- MBA in International Business
- MBA in Information Technology
- MBA in Healthcare Management
- MBA In General Management
- MBA in Agriculture
- MBA in Supply Chain Management
- MBA in Entrepreneurship
- MBA in Project Management
- Management Program
- Consumer Behaviour
- Supply Chain Management
- Financial Analytics
- Introduction to Fintech
- Introduction to HR Analytics
- Fundamentals of Communication
- Art of Effective Communication
- Introduction to Research Methodology
- Mastering Sales Technique
- Business Communication
- Fundamentals of Journalism
- Economics Masterclass
- Free Courses
- Home
- Blog
- Software Development
- Understanding HTML Marquee Tag Attributes: Key Features and Examples
Understanding HTML Marquee Tag Attributes: Key Features and Examples
Updated on Feb 14, 2025 | 19 min read
Share:
Table of Contents
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.
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.
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:
- Master of Design in User Experience
- Professional Certificate Program in Cloud Computing and DevOps
- AI-Powered Full Stack Development Course by IIITB
- Professional Certificate Program in UI/UX Design & Design Thinking
- Object Oriented Analysis and Design for Beginners
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.
Explore our Popular Software Engineering Courses
Master in-demand Software Development skills like coding, system design, DevOps, and agile methodologies to excel in today’s competitive tech industry.
In-Demand Software Development Skills
Stay informed with our widely-read Software Development articles, covering everything from coding techniques to the latest advancements in software engineering.
Read our Popular Articles related to Software
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?
Get Free Consultation
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
Top Resources