A HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your web site page depending on the settings. This is created by using HTML tag <marquees>.
NOTE:Â The HTML <marquee> is an MSIE extension, but is now supported by NS 7 also. So please check if your browser supports this tag or not.
Example:
A simple example to use marquee is as follows:
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee>This is basic example of marquee</marquee> <marquee direction="up">The direction of text will be from bottom to top.</marquee> </body> </html>
Attrubutes:
A HTML marquee can have following attributes:
- width:Â how wide the marquee is. This will have a value like 10 or 20%etc.
- height:Â how tall the marquee is. This will have a value like 10 or 20% etc.
- direction: which direction the marquee should scroll. This will have value either up,down, left or right.
- behavior: what type of scrolling. This will have value scroll, slid and alternate.
- scrolldelay:Â how long to delay between each jump. This will have a value like 10 etc.
- scrollamount:Â how far to jump. This will have a value like 10 etc.
- loop:Â how many times to loop. The default value is INFINITE, which means that the marquee loops endlessly.
- bgcolor:Â background color. This will have any color name or color hex value.
- hspace:Â horizontal space around the marquee. This will have a value like 10 or 20%etc.
- vspace:Â vertical space around the marquee. This will have a value like 10 or 20%etc.
Examples:
<!DOCTYPE html> <html> <head> <title>HTML marquee Tag</title> </head> <body> <marquee>This is basic example of marquee</marquee> </body> </html>
This will produce the following output.