Marquee Tag

A marquee tag is used to scroll the text or image on web pages.

Attributes of Marquee:
  1. direction=left|right|up|down - specifies the direction in which marquee should scroll.
  2. behavior=scroll|slide|alternate - specifies the type of scrolling of the marquee.
  3. width - specifies the width of the marquee.
  4. height - specifies the height of the marquee.
  5. scrolldelay - specifies how long to delay between each jump.
  6. scrollamount - specifies the speed of marquee text.
  7. loop - specifies how many times to loop.
  8. bgcolor - specifies background color in terms of color name or color hex value.
  9. hspace - specifies horizontal space around the marquee.
  10. 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. Text scrolling towards right. Text scrolling towards up. Text scrolling towards down.

Example2:

Scrolling text behavior.

<marquee behavior="scroll">
Scroll behavior
</marquee>
<marquee behavior="slide">
Slide behavior
</marquee>
<marquee behavior="alternate">
Alternate behavior
</marquee>

Scroll behavior Slide behavior Alternate behavior

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. Speed text. This text scrolls only 3 times. Set background color of scrolling area.

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.