Advertisement

Advertisement


HTML Marquee

The <marquee> tag is used to scroll a image or text horizontally or vertically. In simple words, it scrolls the image or text up, down, left or right automatically.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Marquee Tag </title>
</head>
<body>
<marquee> This is an example of HTML marquee. </marquee>
</body>
</html>

Output

HTML Marquee Tag Examples This is an example of HTML marquee.

The 'Scroll' Marquee

It is a by default property. It is used to scroll the text from right to left by default, and restarts at the right side of the marquee when it is reached to the end of left side.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Scroll Attribute </title>
</head>
<body>
<marquee width="100%" behavior="scroll" direction="up">
This is an example of a scroll marquee Up Side Direction...
</marquee>
</body>
</html>

Output

HTML Marquee Scroll Attribute This is an example of a scroll marquee Up Side Direction...

The 'Slide' Marquee

It scrolls the text from right to left and at the end it stop Moving.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Marquee Slide Attribute </title>
</head>
<body>
<marquee width="100%" behavior="slide">
This is an example of a slide marquee...
</marquee>
</body>
</html>

Output

HTML Marquee Slide Attribute This is an example of a slide marquee...

The 'Alternate' Marquee

It scrolls the text from right to left and then goes back left to right.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Marquee Alternate Attribute </title>
</head>
<body>
<marquee width="100%" behavior="alternate">
This is an example of a alternate marquee...
</marquee>
</body>
</html>

Output

HTML Marquee Alternate Attribute This is an example of a alternate marquee...

The 'Direction' Marquee

This is used to change the direction of scrolling text. The direction can be left, right, up and down.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> HTML Marquee Direction Attribute </title>
</head>
<body>
<marquee width="100%" behavior="scroll" direction="up">
This is an example of a Up side direction marquee...
</marquee>
</body>
</html>

Output

HTML Marquee Direction Attribute Examples This is an example of a Up side direction marquee... This is an example of a Down side direction marquee... This is an example of a Right side direction marquee... This is an example of a Left side direction marquee...

HTML Marquee Attributes

Attribute Description
behavior It sets the behavior of the marquee to one of the three different types: scroll, slide and alternate.
direction It defines the direction for scrolling content, like left/right/up/down.
height It defines the height of marquee in pixels or '%'.
width It defines the width of marquee in pixels or '%'.
hspace It defines horizontal space in pixels around the marquee.
vspace It defines vertical space in pixels around the marquee.
scrolldelay It defines scroll delay in seconds.
scrollamount It defines scroll amount in number.
loop It defines loop for marquee content in number.
bgcolor It defines background color. It is now depreciated.

Browser Support

Element
Microsoft Edge browser.png Edge
Chrome browser.png Chrome
Firefox browser.png Firefox
Opera browser.png Opera
safari browser.png Safari
<marquee>
Yes
Yes
Yes
Yes
Yes









Become a Patron!

Note: If the updated content is not visible to you please refresh the cookies by pressing CTRL + Shift + R.