A marquee tag is used to scroll the text or image on web pages.
Attributes of Marquee:- direction=left|right|up|down - specifies the direction in which marquee should scroll.
- behavior=scroll|slide|alternate - specifies the type of scrolling of the marquee.
- width - specifies the width of the marquee.
- height - specifies the height of the marquee.
- scrolldelay - specifies how long to delay between each jump.
- scrollamount - specifies the speed of marquee text.
- loop - specifies how many times to loop.
- bgcolor - specifies background color in terms of color name or color hex value.
- hspace - specifies horizontal space around the marquee.
- vspace - specifies vertical space around the marquee.
Example1:
Scrolling text in various directions.
<marquee direction="left">
Text scrolling towards left.
</marquee>
<marquee direction="right">
Text scrolling towards right.
</marquee>
<marquee direction="up">
Text scrolling towards up.
</marquee>
<marquee direction="down">
Text scrolling towards down.
</marquee>
Text scrolling towards left.
</marquee>
<marquee direction="right">
Text scrolling towards right.
</marquee>
<marquee direction="up">
Text scrolling towards up.
</marquee>
<marquee direction="down">
Text scrolling towards down.
</marquee>
Example2:
Scrolling text behavior.
<marquee behavior="scroll">
Scroll behavior
</marquee>
<marquee behavior="slide">
Slide behavior
</marquee>
<marquee behavior="alternate">
Alternate behavior
</marquee>
Scroll behavior
</marquee>
<marquee behavior="slide">
Slide behavior
</marquee>
<marquee behavior="alternate">
Alternate behavior
</marquee>
Example3:
The following example shows functionality of scrolldelay, scrollamount, loop and bgcolor.
<marquee scrolldelay="300">
Delay text.
</marquee>
<marquee scrollamount="200">
Speed text.
</marquee>
<marquee loop="3">
This text scrolls only 3 times.
</marquee>
<marquee bgcolor="cyan">
Set background color of scrolling area.
</marquee>
Delay text.
</marquee>
<marquee scrollamount="200">
Speed text.
</marquee>
<marquee loop="3">
This text scrolls only 3 times.
</marquee>
<marquee bgcolor="cyan">
Set background color of scrolling area.
</marquee>
Example4:
This example shows how to start and stop scrolling the text.
<marquee onmouseover="this.stop()" onmouseout="this.start()">
This is scrolling text.
</marquee>
This is scrolling text.
</marquee>