HTML Marquees
The Marquee HTML tag is a non-standard HTML element that was popular in the early days of the web. It is used to create a scrolling effect for text or images, either horizontally or vertically. However, it is not recommended to use the Marquee tag in modern web development because it is not part of the HTML standard and is not supported by all browsers.
The Marquee tag was first introduced by Microsoft's Internet Explorer and was later adopted by other browsers. It is often compared to Netscape's blink element, which is another non-standard HTML tag used to create an animation effect.
Warning: Both tags are considered outdated and not recommended for use in modern web development. Instead, CSS animations and transitions are preferred for creating dynamic and interactive web content.
Attributes of marquee tag
Marquee's element contains several attributes that are used to control and adjust the appearance of the marquee.
Tag |
Description |
behavior |
It facilitates the user to set the behavior of the marquee to one of the three different types: scroll, slide, and alternate. |
direction |
defines the direction for scrolling content. It may be left, right, up or down. |
width |
defines the width of the marquee in pixels or %. |
height |
defines the height of the marquee in pixels or %. |
hspace |
defines horizontal space in pixels around the marquee. |
vspace |
defines vertical space in pixels around the marquee. |
scrolldelay |
defines scroll delay in seconds. |
scrollamount |
defines scroll amount in number. |
loop |
defines loop for marquee content in number. |
bgcolor |
defines background color. It is now deprecated. |
HTML scroll marquee
It is a by-default property. It is used to scroll the text from right to left, and restarts at the right side of the marquee when it is reached to the end of the left side. After the completion of the loop, the text disappears.
HTML slide marquee
In the slide marquee, all the contents to be scrolled will slide the entire length of the marquee but stops at the end to display the content permanently.
HTML alternate marquee
It scrolls the text from right to left and goes back from left to right.
Direction in marquee
This is used to change the direction of the scrolling text. Let's take an example of a marquee scrolling to the right. The direction can be left, right, up, and down.
HTML nested marquee
This tag is used to embed the marquee within the primary marquee tag.
Disadvantages of marquee
The disadvantages of the marquee are as follows:-
- It is a non-standard HTML element.
- Marquee may be distracting because human eyes are attracted to movement and marquee texts constantly, which makes the text harder to read.
- Since Marquee text moves, so it is more difficult to click the static text, depending on the scrolling speed.
Supporting Browsers
All these browsers support it for compatibility with the legacy pages, although the element is non-compliant with HTML.
Element |
|||||
Marquee |
Yes |
Yes |
Yes |
Yes |
Yes |