Marquee Tag in HTML

You are currently viewing Marquee Tag in HTML

The marquee tag is used to display the text scrolling and animation in the HTML web pages. HTML provides a special feature to display scrolling and animated text on the web page. This tag is supported by Internet Exploit, Firefox and Netscape 7 and above. Netscape has a blink tag to display blinking text but Internet Explorer does not support blink tag.

Marquee tag can be used to scroll text or image in different directions. The text placed inside the marquee tag scrolls horizontally across the screen or the web page. This scrolling text is normally used to give messages or display some special announcements to the visitors. This tag is working for both images and text.

Attributes of Marquee Tag

Some most important attributes are as follows:

AttributeDescription
Behavior It indicated how the contents will scroll. The possible values are scroll, slide, and alternate. The scroll value is the default value. It indicates that the content scrolls off the edge of the marquee area and then reappears on the other side. The sliding value is almost the same. It also indicates that when the content reaches the left edge it stops without scrolling off. The alternate value makes the context bounce back and forth. All contents remain visible all the time.
BgcolorUsed to set the background color of the marquee. Its value can be given as a combination of red, green and blue or name of the color. The hexadecimal value of the color can also be used.
DirectionIt indicates the direction to which the marquee will scroll. The possible values are up, down, left and right, the default value is left. The left value indicates that the marquee starts at the right and moves to left across the page. The right value indicates that the marquee starts at the left and moves to right across the page.
HeightIt defines the height of marquee. It is given in pixels or percentages.
HspaceIt is used to set the horizontal space to the left and right of the marquee. Its value is given in pixels.
LoopIf specifies the number of times the marquees will school. The default value is infinite.
Scroll delayIt is used together with a scroll amount to set the speed of the scrolling. Marquee moves the content by displaying the content and then delays for some period of time specified in the scroll delay. Its value is given in milliseconds. The default delay is 85.
Scroll amountIt is us together with a scroll delay to set the speed of the scrolling. Marquee moves the content by displaying the content and delays for some period of time. It then displays the content in a new position specified in scroll amount that sets the size in pixels of each jump. If we set the scroll amount value higher than marquee scroll fast. The default value is 6.
WidthIf defines the width of the marquee. It is given in pixels.
VspaceIt is used to set vertical space at the top and bottom of the marquee. It is given in pixels.

Examples



Marquee Tag for Text

<html>
	<head>
		<title>wuexerice</title>
	</head>
	<body>
		<marquee onmouseover=this.stop(); onmouseout=this.start(); scrollamount=12;> <h1>Hello wuschooler <i>Muhammad Waqar</i> </h1> </marquee>

	</body>
</html>

Output

Hello wuschooler Muhammad Waqar

Marquee Tag for Image

<html>
	<head>
		<title>wuexerice</title>
	</head>
	<body>
		<marquee onmouseover=this.stop(); onmouseout=this.start(); scrollamount=20;> 
<img src="https://wuschools.com/wp-content/uploads/2020/02/Pink-and-Purple-Events-party-Entertainment-Logo.png" alt="marquee tag">
</marquee>

	</body>
</html>

Output

marquee tag

Reference

If you want to learn more about HTML then visit the official website: Visit

Visit the HTML tutorial list. And make strong your HTML concept. Click here. wuschools.com is always written about the HTML concept for the HTML lover. Ang writes about how HTML makes your life easy if you are a web site developer. We help you to continue your learning.

This Post Has One Comment

  1. Katherine

    Everything is very open with a precise explanation of the challenges.
    It was truly informative. Your site is very helpful. Thank you for sharing!

Leave a Reply