HTML - Marquee
Using <marquee> tag we can scroll text or image either horizontally or vertically on our web page.
Syntax
<marquee> The Scrolling Text or Image</marquee>
Example
<!DOCTYPE html> <html> <head> <title>Scrolling Text Example</title> </head> <body> <marquee> The Scrolling Text or Image</marquee> </body> </html>
Output
Attributes of Marquee:
Attributes | Value | Description |
---|---|---|
behavior | scroll slide alternate | It defines the scrolling type. |
bgcolor | rgb(x,x,x) #xxxxxx colorname | It is used to give a background color. |
direction | up down left right | It sets the direction for the scrolling content. |
height | pixels % | It defines the marquee's height. |
hspace | pixels | It defines horizantal space around the marquee. |
loop | number | It defines how many times the content will scroll. If we don't define this, the content will scroll forever. |
scrollamount | number | It defines the scrolling amount at each interval in pixels. Default value is 6. |
scrolldelay | seconds | It defines how long delay will be between each jump. The default value is 85 and smaller amounts than 60 will be ignored. |
truespeed | seconds | If you use this attribute, you can delay the scroll lesser than 60. |
vspace | pixels | It defines vertical space around the marquee. |
width | pixels % | It defines the marquee's width. |
Example of Direction attribute
<!DOCTYPE html> <html> <head> <title>Scrolling Image right direction Example</title> </head> <body> <marquee direction="right"><img src="bird.gif" width="100" height="100"></marquee> </body> </html>
0 Comments