HTML-Marquees
Marquee is an HTML tag that was widely used in the past to create scrolling or moving text or images on a web page. However, as of HTML5, the marquee element has been deprecated, which means it is no longer recommended for use. Instead, you are encouraged to use CSS animations and transitions to achieve similar effects.
Here’s an example of how you can create a scrolling text using CSS animations:
1 2 3 4 5 6 7 8 9 10 11 12 |
<!DOCTYPE html> <html> <head> <title>Marquee Example</title> </head> <body> <marquee behavior="scroll" direction="left" scrollamount="5"> This is a scrolling text using the marquee tag. </marquee> </body> </html> |
In this example, a <marquee>
element is used to create a scrolling text. The behavior
attribute is set to “scroll” to specify that the text should continuously scroll. The direction
attribute is set to “left” to make the text scroll from right to left. The scrollamount
attribute is set to “5” to determine the speed of the scrolling text.
<marquee>
Tag attribute
behavior
: This attribute determined the direction and style of the scrolling. Possible values were “scroll” (default), “slide,” or “alternate.”direction
: This attribute specified the direction of the scrolling. It could be set to “left,” “right,” “up,” or “down.”scrollamount
: This attribute determined the speed of the scrolling content. You could specify a numeric value representing pixels or a predefined value like “slow,” “normal,” or “fast.”scrolldelay
: This attribute set the delay between each scroll movement. It could be specified in milliseconds.loop
: This attribute determined the number of times the scrolling content would loop. A positive integer value indicated the number of loops, while “-1” represented an infinite loop.width
andheight
: These attributes allowed you to set the dimensions (width and height) of the marquee.
Here’s an example of how the <marquee>
tag with attributes could be used:
1 2 3 4 |
<marquee behavior="scroll" direction="left" scrollamount="5" scrolldelay="100" loop="infinite" width="300" height="100"> This is a scrolling text using the marquee tag. </marquee> |