What is the basic syntax for HTML marquee?The HTML marque in its simplest form is displayed as follow:
The syntax is as follow: <MARQUEE>This a scrolling text using HTML marquee</MARQUEE> |
How to set the speed of the HTML marquee?The HTML marquee has an attribute called SCROLLAMOUNT and SCROLLDELAY. These elements can be used together to set the speed of the HTML marquee. The HTML marquee moves text by waiting for a while and then rendering the text in a new position by jumping to a new position. SCROLLAMOUNT determines the amount of pizels to jump with each render of the HTML marquee. SCROLLAMOUNT has a default value of 6. SCROLLDELAY on the other hand determines how long to wait before the next render takes place. SCROLLDELAY has a value in milliseconds. SCROLLDELAY has a default value of 85.
Here are some examples:
<MARQUEE SCROLLDELAY="10" SCROLLAMOUNT="20"> This is a very fast scrolling HTML marquee. </MARQUEE>
<MARQUEE SCROLLDELAY="100" SCROLLAMOUNT="2"> This is a very slow scrolling HTML marquee. </MARQUEE> |
How to set the direction of the HTML marquee?The HTML marquee has an attribute called DIRECTION. The DIRECTION attribute determines in which direction the text will scroll. The DIRECTION attribute can either be LEFT, RIGHT, UP or DOWN.
Here are some examples:
<MARQUEE DIRECTION="RIGHT"> This is HTML marquee scrolling RIGHT. </MARQUEE>
<MARQUEE DIRECTION="UP"> This is HTML marquee scrolling UP. </MARQUEE>
<MARQUEE DIRECTION="DOWN"> This is HTML marquee scrolling DOWN. </MARQUEE> |
What alternate behaviour does the HTML marquee have?The HTML marquee has an attribute called BEHAVIOR. The BEHAVIOR attribute can have one of 3 values:
- SCROLL: The SCROLL attribute will slide the text into the HTML marquee and out again. This is the default behavior.
- SLIDE: The SLIDE attribute will scroll the text into the HTML marquee and will stop as soon as the text hits the side. During testing, the SLIDE attribute did not work correctly in FireFox Version 1.0.6.
- ALTERNATE: The ALTERNATE attribute will scroll text back and forth within the HTML marquee.
Here are some examples:
<MARQUEE BEHAVIOR="SLIDE"> This a HTML marquee with SLIDE behavior. </MARQUEE>
<MARQUEE BEHAVIOR="ALTERNATE"> This a HTML marquee with ALTERNATE behavior. </MARQUEE> |
Will the HTML marquee work correctly with other HTML markup like images?Yes, have a look at the example below:
<MARQUEE DIRECTION="RIGHT"> <IMG SRC="http://www.whadiz.com/images/articleimages/dalmation_marquee.gif" /> </MARQUEE>
|
What other attributes or codes does the HTML marquee have?
ALIGN |
CENTER LEFT RIGHT |
BEHAVIOR |
SCROLL SLIDE ALTERNATE |
BGCOLOR |
The background color of the html marquee. |
DIRECTION |
LEFT RIGHT UP DOWN
|
WIDTH |
Determines the width of the HTML marquee either in pixels or a percentage
value. |
HEIGHT |
Determines the height of the HTML marquee either in pixels or a percentage
value. |
HSPACE |
Number of pixels to the right and the left of the HTML marquee. |
VSPACE |
Number of pixels to the top and the bottom of the HTML marquee. |
LOOP |
Determines the number of times the HTML marquee should loop. The default value is
INFINITE. |
SCROLLAMOUNT |
Determines the number of pixels the HTML marquee should should with each
rerender. |
SCROLLDELAY |
Determines how long in milliseconds the HTML marquee should wait before it should
rerender. |
|
What browsers support HTML marquee?Most modern browsers support HTML marquee. Internet Explorer 3+, as well as FireFox supports HTML marquee. The use of HTML marquee is limited in FireFox, as some attributes of the HTML marquee might not be supported. Netscape never supported HTML marquee and only started supporting HTML marquee from Netscape version 7. HTML marquee support is thus limited in browsers like Firefox, Opera and Safari. FireFox, Opera and Safari does not gaurantee correct rendering and they support the HTML marquee purely for legacy page compatibility. |
What happens if HTML marquee is not supported?If the HTML marquee is not supported, the text within in the HTML marquee will not scroll and will simply stand still. Thus you should allways make sure that the text looks and renders correctly if the HTML marquee is not supported by the browser being viewed in. |
Is the usage of HTML marquee recommended?No, the use of HTML marquee is not recommended. HTML marquee was an invention by Microsoft. The HTML marquee is unofficial in XHTML and HTML. JavaScript implementations of a scrolling text marquee might be more reliable if reliability is of concern. Have a look at this example of a JavaScript slide marquee. |