<marquee> Tag Attributes Satyaki Das | Contact No. 8981838547 .
An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings. This is created by using HTML <marquees> tag. Note − The <marquee> tag deprecated in HTML5. Do not use this element, instead you can use JavaScript and CSS to create such effects.
Sr.No Attribute & Description 1 width This specifies the width of the marquee. This can be a value like 10 or 20% etc. 2 height This specifies the height of the marquee. This can be a value like 10 or 20% etc. 3 direction This specifies the direction in which marquee should scroll. This can be a value like up, down, left or right. 4 behavior This specifies the type of scrolling of the marquee. This can have a value like scroll, slide and alternate. 5 scrolldelay This specifies how long to delay between each jump. This will have a value like 10 etc.
6 scrollamount This specifies the speed of marquee text. This can have a value like 10 etc. 7 loop This specifies how many times to loop. The default value is INFINITE, which means that the marquee loops endlessly. 8 bgcolor This specifies background color in terms of color name or color hex value. 9 hspace This specifies horizontal space around the marquee. This can be a value like 10 or 20% etc. 10 vspace This specifies vertical space around the marquee. This can be a value like 10 or 20% etc. Satyaki Das | Contact No. 8981838547 .
Width and Height Attributes WIDTH and HEIGHT set the dimensions of the marquee. <marquee width=200 height=50>Hello</marquee> Neither attribute is required. The default value for WIDTH is 100%. The HEIGHT defaults to the natural height of content as it appears in the width. DIRECTION=LEFT, which is the default, indicates that the marquee starts at the right and moves leftwards across the page. DIRECTION=RIGHT indicates that the marquee starts at the left and moves rightwards across the page. <marquee direction="left">Classroom. </marquee> <marquee direction="right">Classroom. </marquee> The Direction Attribute
The Behavior Attribute BEHAVIOR indicates how the contents scroll. BEHAVIOR=SCROLL , which is the default, indicates that the content should scroll off the edge of the marquee area, then reappear on the other side. This code: <marquee behavior=scroll>Hello</marquee> BEHAVIOR=SLIDE is almost the same, except that it indicates that when the leading part content reaches the left edge it should stop without scrolling off. Notice in this example that the contents stop scrolling as soon as the “H” reaches the left side: <marquee behavior=slide>Hello</marquee>
BEHAVIOR=ALTERNATE makes the content bounce back and forth, all of it remaining visible all the time (assuming of course that it all fits). <marquee behavior=alternate>Hello</marquee> Satyaki Das | Contact No. 8981838547 .
The Scrollamount Attribute SCROLLAMOUNT, together with SCROLLDELAY, sets the speed of the scrolling. Marquee moves the content by displaying the content, then delaying for some short period of time, then displaying the content again in a new position. SCROLLAMOUNT sets the size in pixels of each jump. A higher value for SCROLLAMOUNT makes the marquee scroll faster. The default value is 6. The following examples demonstrate the default value for SCROLLAMOUNT, a value of 20 and 50. <marquee> Hello </marquee> <marquee scrollamount =20> Hello </marquee> <marquee scrollamount =50> Hello </marquee>
The BGColor Attribute BGCOLOR sets the background color of the marquee. <marquee bgcolor =cyan> Hello </marquee> Satyaki Das | Contact No. 8981838547 .
HSpace and VSpace Attributes < marquee width="25%" bgcolor =cyan ><p> Classroom </p> We are simply different. </p></marquee> Welcome < marquee hspace =10 width="25%" bgcolor =cyan ><p> Classroom </p> We are simply different. </p></marquee> Welcome < marquee hspace =50 width="25%" bgcolor =cyan ><p> Classroom </p> We are simply different. </p></marquee> Welcome HSPACE sets the horizontal space to the left and right of the marquee. VSPACE sets the vertical space at the top and bottom of the marquee. HSPACE has no effect unless you also use the HSPACE attribute. These three code examples show the default value of HSPACE (which is 0) and two larger values:
VSPACE sets the space between the marquee and text before and after. These code examples show the default value of VSPACE (also 0) and two larger values: Mission 2020 < marquee width="25%" bgcolor =cyan >< p> Classroom </p> We are simply different. </p></marquee> Welcome Mission 2020 < marquee vspace =10 width="25%" bgcolor =cyan >< p> Classroom </p> We are simply different. </p></marquee> Welcome Mission 2020 < marquee vspace =50 width="25%" bgcolor =cyan > <p> Classroom </p> We are simply different. </p></marquee> Welcome
The Loop Attribute LOOP sets howmany times the marquee shouldloop . The default value (i.e. if you don’t put a LOOP attribute at all) is INFINITE, which means that the marquee loops endlessly. This code creates a marquee that loops twice: One of the problems with LOOP is that the content disappears after the last loop. To set the marquee so that the content is visible when the looping is done set BEHAVIOR=SLIDE: <marquee loop=2> Classroom</marquee> <marquee loop=2 behavior=slide> Classroom</marquee>