<marquee> Tag in HTML
The <marquee> tag is used to create scrolling text or images within a webpage. It allows content to move horizontally or vertically across the screen. Although it was widely used in older websites, the <marquee>
tag is now obsolete and not recommended for modern web development.
Key Points on <marquee> Tag:
- Can be used to scroll text or images horizontally or vertically.
- Supports various attributes for direction, speed, and behavior.
- Is not part of the HTML5 standard and is not recommended for accessibility and modern usage.
- Alternative CSS animations or JavaScript are preferred for creating scrolling effects.
Syntax of <marquee> Tag:
Syntax Example
<marquee>Scrolling Text</marquee>
Example of <marquee> Tag in HTML:
This example shows a basic scrolling text using the <marquee>
tag.
Code Example
<marquee>Welcome to Our Website!</marquee>
Output
Attributes of <marquee> Tag:
- Direction: Specifies the direction of scrolling (left, right, up, down).
- Behavior: Defines the scrolling behavior, such as scroll, slide, or alternate.
- Scrollamount: Sets the speed of the scrolling text (larger values make it scroll faster).
- Loop: Determines the number of times the marquee should loop.
Due to its limited support and outdated status, using the <marquee>
tag is discouraged in modern web design. Instead, consider using CSS animations or JavaScript for creating scrolling effects to ensure better accessibility and compatibility.