Marquee Alternate HTML Tag Guide W3Schools Tutorial

The <marquee> tag is a now-deprecated HTML element once used to create scrolling or moving text on a webpage. As part of the non-standard HTML4 tag collection, the <marquee> tag is not supported in modern HTML5 and has been phased out due to accessibility concerns and inconsistencies in rendering across different browsers. However, for educational purposes or historical context, let's discuss the basics of using this tag, guided by guidance from W3Schools, a popular resource for web developers.

CSS-Only Marquee Effect - Menu Hover Effect - Coding - Fribly
CSS-Only Marquee Effect - Menu Hover Effect - Coding - Fribly

Before we delve into the details, it's important to note that using the <marquee> tag for new projects is strongly discouraged. The focus should be on creating accessible and responsive web experiences using current HTML5 standards and CSS for styling and animation effects.

Marquee tag attributes
Marquee tag attributes

Understanding the <marquee> Tag

At its core, the <marquee> tag was used to create a scrolling or moving text effect. The text inside the <marquee> tag would scroll horizontally from right to left, or vertically from bottom to top, depending on the specified behavior. This tag had several attributes to control its behavior, such as direction, scroll amount, and looping.

Pure CSS 3D Marquee Text Animation Effect
Pure CSS 3D Marquee Text Animation Effect

However, due to its non-standard nature and accessibility issues, the <marquee> tag was officially deprecated in HTML5. Browsers no longer support this tag, and its use may lead to unexpected behavior or broken layout in modern web browsers.

Using the <marquee> Tag

a computer screen with the text html and an image of a web page on it
a computer screen with the text html and an image of a web page on it

Despite its depreciation, understanding how the <marquee> tag worked can provide historical context and demonstrate the evolution of HTML. Here's a basic example of how to use the <marquee> tag, sourced from W3Schools:

<marquee behavior="scroll" direction="left">This text will scroll from right to left.</marquee>

The <behavior> attribute specified the type of movement, which could be either "scroll" for continuous movement or "slide" for a to and fro slideshow effect. The <direction> attribute determined the direction of the movement, which could be "left", "right", "up", or "down".

Attribute Values and Compatibility

CSS Infinite Marquee Webflow cloneable
CSS Infinite Marquee Webflow cloneable

The <marquee> tag had several other attributes for fine-tuning the scrolling effect, such as <scrollamount> for setting the speed, <loop> for specifying the number of times the scrolling should loop, and <bgcolor> for setting the background color of the marquee.

It's crucial to remember that these attributes had varying levels of support across different browsers. For instance, not all browsers supported the <behavior> attribute, and some older browsers might not render the marquee effect at all.

Alternatives to the <marquee> Tag

an image of a web page with the words'body'and'reader '
an image of a web page with the words'body'and'reader '

With the advent of HTML5 and CSS3, several more accessible and consistent alternatives have emerged for creating scrolling or animated text effects. These include using CSS animations, transforms, and keyframes, along with JavaScript for interactivity.

For instance, creating a simple horizontal scroll effect can be achieved using CSS transforms and animations, along with a container with overflow settings:

Magic Navigation Menu, HTML and #CSS
Magic Navigation Menu, HTML and #CSS
CSS-Only Marquee Effect | Codrops
CSS-Only Marquee Effect | Codrops
the web 2 0 and web 3 0 are shown in three different stages, one is red
the web 2 0 and web 3 0 are shown in three different stages, one is red
18 Exciting HTML and CSS Project Ideas with source code to Level Up Your Web Development Skills
18 Exciting HTML and CSS Project Ideas with source code to Level Up Your Web Development Skills
a blackboard with text and diagrams on it
a blackboard with text and diagrams on it
the before and after css web page is shown with an image of two screens
the before and after css web page is shown with an image of two screens
Html&Css 👨‍💻
Html&Css 👨‍💻
liMarquee - Horizontal and Vertical Scrolling of Text or Image or HTML Code free download
liMarquee - Horizontal and Vertical Scrolling of Text or Image or HTML Code free download
an image of a computer screen with the words html and css written in it
an image of a computer screen with the words html and css written in it
a computer screen with the words padding vs margin on it and an image of a
a computer screen with the words padding vs margin on it and an image of a
an image of the back side of a computer screen with text that reads, add css to html
an image of the back side of a computer screen with text that reads, add css to html
Add Watermark With HTML & CSS
Add Watermark With HTML & CSS
Website cupcake design using html and css.mp4
Website cupcake design using html and css.mp4
✨ Create an Animated HTML & CSS! 🚀 #Coding #CSSAnimation #Shorts
✨ Create an Animated HTML & CSS! 🚀 #Coding #CSSAnimation #Shorts
Semantic HTML Explained Visually (Beginner Guide)
Semantic HTML Explained Visually (Beginner Guide)
the ultimate guide to creating and using html - css projects for everyone
the ultimate guide to creating and using html - css projects for everyone
Login and Registration Form in HTML & CSS
Login and Registration Form in HTML & CSS
Title: HTML Semantic vs Non-Semantic Tags – Guide by RajNandani
Title: HTML Semantic vs Non-Semantic Tags – Guide by RajNandani

marquee-container { overflow: hidden; white-space: nowrap; } marquee { display: inline-block; animation: marquee 5s linear infinite; } @keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

Modern Alternatives and Accessibility

These modern alternatives offer better control, consistency, and accessibility. By using CSS for styling and animations, and JavaScript for interactivity, web developers can create engaging experiences that work reliably across different browsers and devices.

Moreover, these modern techniques allow for better control over the user experience, including options to pause, resume, or stop animations based on user interaction or screen reader use, improving accessibility.

In the broader context, the deprecation of the <marquee> tag illustrates the ongoing evolution of HTML and web standards. As the web becomes more dynamic and user-focused, there's a growing emphasis on creating accessible, responsive, and future-proof experiences that can adapt to the diverse needs and devices of today's users.

Related Articles

How To Add Favicon In Html W3schools Menu Desplegable Html W3schools Html Media Query Example Marquee Alternate Html W3schools W3schools Html Quote Menu DÃroulant Html W3schools W3schools Html Metadata W3schools Html Formatting W3schools Html Form Tag Example Footer Html Css W3schools