Note. This tag is not part of HTML 3.2 and is only supported by Microsoft Internet Explorer so if you are viewing this page using any other browser you won't see anything very interesting.
The <marquee> tag is used to introduce text that scrolls horizontally within a display box. The usual warnings about the distracting and annoying nature of continuously running animations apply. Here's a simple example
And here's the HTML
<p align=center> <font size=+3 color=red> <marquee width=75%> Hello, World </marquee> </font> </p>
IE3, apparently, does not honour any other tags that appear within a marquee so it is impossible to animate multi-coloured text or images this way. This restriction has been relaxed in IE4.
The tag, which is a container tag, has no fewer than 11 attributes.
This tag can take one of the values top, middle and bottom. It controls the positioning of the marquee display box relative to the current text in exactly the same manner as the <img> tag's align attribute.
This tag controls the behaviour of the displayed text. There are three possible values. Text scrolling starts as soon as the page is downloaded, not when the user firsts scrolls the marquee into view.
value | effect | example |
---|---|---|
scroll | text scrolls across display and re-appears from the other end when it has disappeared from one end. This is the default behaviour. | |
slide | This is similar to scroll except that when the sliding text reaches the far end of the box, it disappears and restarts at the starting end of the box. If the display is not looping then the text remains positioned at the far end of the box. | |
alternate | text "bounces" between the ends of the box |
This tag controls the background colour of the display box, in the example above the display box background colour was set to aqua whereas the table cell background colour was set to white
This attribute controls the direction of scrolling. Permissible values are left and right specifying the end of the box that the scroll starts from. Here's some examples.
value | effect | example |
---|---|---|
right | starts at right hand end | |
left | starts at left hand end |
It appears that the value of this attribute does not affect the behaviour of the marquee if the value of the behavior attribute is alternate
The following four attributes are used in exactly the same way as they are used with the <img> tag.
This controls the height of the display box.
This controls the width of the display box.
This controls the horizontal space around the display box.
This controls the vertical space around the display box.
The value of this attribute controls the number of display cycles. The values -1 and infinite both mean continue indefinitely.
This controls the amount of movement (in pixels) between the successive displays that give the impression of animation.
This controls the delay (in milliseconds) between the successive displays that give the impression of animation.
Here are some examples
scrollamount | scrolldelay | example |
---|---|---|
5 | 5 | |
5 | 500 | |
50 | 5 | |
50 | 500 |
The final example should be enough to illustrate the distracting effects of too much animation.