The marquee tag, how do we use it.

  »   Miscellaneous  »   The marquee tag, How do we use it.

I will show you in this article some ways you can animate text with the marquee tag. The marquee tag is an HTML element that makes text move from left to right and top to down.

I will illustrate these animations using the examples shown below.

Practical examples using marquee tag

From right to left. This is the most simple animation given and we will not  need a label to achieve the movement.

html<marquee>TEXT</marquee>

Demo

TEXT

From left to right.We will add the attribute direction with the "right" as follows

html<marquee direction="right">TEXT</marquee>

Demo

TEXT

Alternatively. With attribute behavior.

html<marquee behavior="alternate">TEXT</marquee>

Demo

TEXT

The bottom up.

html<marquee direction="up">TEXT</marquee>

Demo

TEXT

From the top down.

html<marquee direction="down">TEXT</marquee>

Demo

TEXT

From the top down alternative.

html<marquee direction="up" behavior="alternate" style="height:100px">TEXT</marquee>

Demo

TEXT

From the top-down as well from left to right at the same time. See the example for a better understanding

html<marquee behavior="alternate" direction="up" width="80%"><marquee direction="right">TEXT</marquee></marquee>

Demo

TEXT

Same example but in a closed space

html<marquee behavior="alternate" direction="up" width="80%">
	<marquee direction="right" behavior="alternate">TEXT</marquee>
</marquee>

Demo

TEXT

On a background

html<font color="WHITE"><marquee direction="left" style="background:RED">TEXT</marquee></font>

Demo

TEXT

In a frame.

html<marquee style="border:RED 3px SOLID">TEXT</marquee>

Demo

TEXT

Picture. Using the above script, may be inserted photos with or without text. They will be introduced like in the following example:

html<marquee>Some text here <img src="http://www.etutoriale.ro/banners/88x31.gif" width="88" height="31" alt="Tutorials " border="0"></marquee>

Demo

Some text here Tutorials

Animation placed in text.

htmlSome text before <marquee WIDTH="20%"><img src="http://www.etutoriale.ro/banners/88x31.gif" width="88" height="31" alt="Tutorials " border="0"></marquee> Some text after.

Demo

Some text before Tutorials Some text after.

It would be something more to say: that the speed of the movement can be changed using "scrolldelay" where an attribute value of "1000" for example, would reduce speed close to 0, while a value of "1" would be a very high speed.

Interrupted movement with attribute scrollamount. A value of "10" for example, will advance the text movement with 10 pixels / frame.

You can also set the number of times the text will pass from right to left for example, using an attribute loop. A value of "3" will let you see the words three times after that will disappear.