marquee (HTML element)
| Depr. | Empty | Version |
|---|---|---|
| Yes | No | N/A |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
Description
The marquee
element provides a way for browsers to render text that moves across the
page without having to resort to JavaScript techniques. The
marquee is non-standard but enjoys (or possibly suffers
from) good browser support.
It is generally considered to be a very unfriendly element to use, one which presents difficulties for many users who may have difficulty tracking the text as it moves. Our advice is not to use it. JavaScript is a more suitable technique for moving text on screen - if there is a valid reason for doing this at all.
Example
A simple marquee with no additional attributes is marked up as follows:
<p><marquee>This text is a moving target. Don't you just love it?</marquee></p>
Use this for…
The
marquee element should contain a short amount of
text.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full |
Support for
marquee is varied. Some browsers will stop animation
regardless of loop settings, some interpret
direction differently, some will honor height and
width attributes, most pay no attention at all.
However, given that this is not part of any HTML recommendation, this is
perhaps to be expected. The simple answer is not to use it if you want to
have valid documents that render consistently and don’t annoy the heck out
of the reader.
In this Section
align
alignment/position of themarqueerelative to surrounding contentbehavior
changes the way that the text moves across the screenbgcolor
background color of the marqueedirection
defines which direction the marquee text should travel inheight
sets the height of the marqueehspace
sets amount of space horizontally left and right) around marquee
tells the browser how many times to move the marquee text across the screenscrollamount
sets the speed at which text in marquee scrollsscrolldelay
slows the text content inside marquee as it moves from side to sidevspace
sets amount of space vertically (top and bottom) around marqueewidth
sets the width of the marquee
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.