Summary -

In this topic, we described about the <marquee> tag along with detailed example.

The <marquee> element was used to scrolling text or image across a defined section of a webpage in a horizontal or vertical direction. The element has been deprecated and no longer be used. HTML <marquee> tag has the below attributes. It is supported by all browsers.

Syntax -

<marquee>.... HTML text here </marquee>
AttributeDescriptionValue
behaviortype of scrolling.scroll, slide, alternate
directionthe direction of scrolling the contentup, down, left, right
heightthe height of marquee.pixels or %
hspaceSpecifies horizontal space pixels
loopSpecifies times to loop. The default value is INFINITE.number
scrolldelaydelay between each jump.seconds
scrollamountfar to jump.number
widththe width of marquee.pixels or %
vspacevertical space around the marquee.pixels

Example -

<!DOCTYPE html>
<html>
	<head>
		<title> marquee tag example</title>
	</head>
	<body>
	
	   <marquee behavior="scroll" direction="left">
	   Scrolling text to left...</marquee><br>
	   <marquee behavior="scroll" direction="right">
	   Scrolling text to right...</marquee>
	
	</body>
</html>

Output -

Scrolling text to left... Scrolling text to right...