Marquees
Although HTML is a static language, marquees can add a certain buzz to a webpage.
This lesson focuses on:
- The <marquee> tag
The <marquee> tag
The <marquee> tag is perhaps one of the most intricate tags in HTML, and rightfully so. While HTML is a static language, the <marquee> tag gives it some movement - literally! This tag creates a moving scroll which travels across a page.NOTE: The <marquee> tag is not considered an 'official' part of HTML 4 and XHTML, but it is still supported by some major browsers such as Internet Explorer and Firefox.
<marquee> tag attributes:
-
bgcolor
Denotes the background color of the marquee. -
loop
Denotes how many times the marquee will scroll across the page. The value for this attribute can be a number used to denote how many times it should scroll or the word 'infinite' denoting that the marquee should scroll forever. -
height
This attribute takes a numerical value which denotes the height of the marquee. -
width
This attribute takes a numerical value which denotes the width of the marquee. -
align
This attribute takes the value of either 'top', 'left', or 'middle' to denote the location of the marquee. -
direction
This attribute takes the value of either 'left' or 'right' to denote which way the marquee will scroll. By default it scrolls to the right. -
behavior
This attribute takes the value of either 'scroll', 'slide', or 'alternate' to denote how the marquee will move. The value of 'scroll' will make the marquee move one way continuously and is the default movement method of the marquee. The value of 'slide' will make the marquee come in and stop. The value of 'alternate' will make the marquee come in from both sides interchangeably. -
hspace
This attribute takes a numerical value that tells the marquee how much space to leave on each side of the text. -
scrollamount
This attribute takes a numerical value that tells the browser how much space between each scroll. -
scrolldelay
This attribute takes a numerical value that tells the browser how many milliseconds there should be between each scroll. -
vspace
This attribute takes a numerical value that tells the marquee how much space there should be at the top and bottom before the text.
Example:
<marquee bgcolor="yellow" loop="infinite" height="100" width="600" align="middle" behavior="alternate" scrolldelay="100"> Hello, I am a scrolling marquee. Watch me scroll. </marquee>
Output:




