The <marquee> tag is an HTML element that was used in earlier versions of HTML to create a scrolling or moving text or image within a web page. It was primarily employed to add dynamic and attention-grabbing effects to text or images. The content within the <marquee> tag would continuously move across the screen in the specified direction.
In HTML, the <marquee> tag is used to create a scrolling or moving text or image. However, it’s important to note that the <marquee> tag is considered deprecated in HTML5, and its usage is discouraged. Instead, you should use CSS animations or other modern techniques for creating similar effects.
Here’s an example of how you can use the <marquee> tag:
<!DOCTYPE html>
<html >
<head>
<title>Marquee Example</title>
</head>
<body>
<marquee behavior=”scroll” direction=”left”>This text will scroll from right to left.</marquee>
</body>
</html>
In this example:
behavior=”scroll” specifies that the content will scroll.
direction=”left” specifies the direction of the scroll (you can use “right”, “up”, or “down” as well).
Again, using the <marquee> tag is not recommended for modern web development. Instead, consider using CSS animations for a more flexible and maintainable approach.
Marquee tag attributes
If you still need information about the attributes of the <marquee> tag , here they are:
1.behavior: Specifies the scrolling behavior. Possible values include:
scroll: Text or image scrolls from one side to another.
slide: Text or image slides in and out of view.
alternate: Text or image scrolls back and forth.
Syntax:
<marquee behavior=”scroll”>This text will scroll.</marquee>
2.direction: Specifies the direction of the scrolling. Possible values include:
left: Scrolls the content (text or img)from right to left.
right: Scrolls the content from left to right.
up: Scrolls the content(text or img) from bottom to top.
down: Scrolls the content from top to bottom.
Syntax:
<marquee direction=”left”>This text will scroll from right to left.</marquee>
3.
scrollamount: Specifies the scrolling speed in pixels. Higher values mean faster scrolling.
Syntax:
<marquee scrollamount=”5″>This text will scroll slowly.</marquee>
4.
scrolldelay: Specifies the delay between each scroll movement in milliseconds.
Syntax:
<marquee scrolldelay=”1000″>This text will have a delay of 1 second between scrolls.</marquee>
5. width: Specifies the width of the marquee.
Syntax:
<marquee width=”50%”>This text will have a width of 50% of the container.</marquee>
6.
height: Specifies the height of the marquee.
Syntax:
<marquee height=”100″>This text will have a height of 100 pixels.</marquee>
Marquee tag in HTML EXAMPLE
<html>
<head>
<title>usage of margin</title>
</head>
<body bgcolor=”pink” text=”green”>
<marquee direction=”center” behavior=”scroll” scrollamount=”5″>
<font size=”+8″><i align=”center”>In HTML, the marquee tag is used to create a scrolling or moving text or image.
</marquee>
<marquee>
<img src=”aa.jpg” height=50 width=50>
</marquee>
</body>
</html>