This tag is used to scroll text horizontally across the screen. It is mainly used to deliver a specific message to the visitor or to scroll Ads on a page. It is not a standard HTML tag and so the browser support for it is typically limited to Internet explorer.
The following lines of code show the use or marquee tag:
<HTML> <HEAD><TITLE> MARQUEE TAG</TITLE></HEAD> <BODY> <H1><MARQUEE>HTTP://ECOMPUTERNOTES.COM</MARQUEE></H1> </BODY> </HTML>
The following code is displayed in which the text within the <MARQUEE>and </MARQUEE> tags scrolls across the screen from right to left. But by including the attribute direction=”right” in marquee tag code changes the direction of flow of text i.e left to right.
By including the attribute direction=”up” in marquee tag of code changes the direction of flow of text from bottom to top and direction=” down” changes the flow of text from top to bottom.
<HTML> <HEAD> <TITLE>EXAMPLE1</TITLE> </HEAD> <BODY BGCOLOR=”PINK”> <MARQUEE DIRECTION=”UP”> <H1 ALIGN=”CENTER”>LAPTOPS<BR>HCL<BR>IBM<BR>HP<BR>LENOVO<BR></H1> </MQRQUEE> </BODY> </HTML>
Attributes used in <MARQUEE> tag
Attribute | Possible values | Functional |
Bgcolor | Anv standard color name or hexadecimal color value. | Specifies the background color of the marquee. |
Direction | Left, Right | Specifies the direction in which the marquee contents Scrolls. |
Height | Any valid percentage or no. of pixels | Specifies the vertical dimension of the marquee |
Behavior | Scroll, Slide, Alternate | Sets the behavior of marquee to one of following: Scroll: Text scrolls like a stock ticker. Slide: Text slides into view. Alternate: Text alternates between scrolling and sliding. |
Width | Any valid percentage or no. of pixels | Specifies the horizontal dimension of the marquee. |
Hspace | Any valid percentage or no. of pixels | Specifies the left and right margin of the marquee |
Vspace | Any valid percentage or no. of pixels | Specifies the top and bottom margin of the marquee. |
Loop | Any positive integer of INFINITE | Controls the number of appearance of the marquee content. |
Scrollamount | Number of pixels | Specifies the shift of marquee text |
Scrolldelay | Number specifying the delay in milliseconds | Specifies how often the marquee text redraws. |