<marquee>

  • Revision slug: HTML/Element/marquee
  • Revision title: marquee
  • Revision id: 328483
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

{{ non-standard_header() }}

Summary

The HTML <marquee> element is used to insert a scrolling area of text.

Attributes

{{ htmlattrdef("behavior") }}
Sets how the text is scrolled within the marquee. Possible values are scroll, slide and alternate. If no value is specified, the default value is scroll.
{{ htmlattrdef("bgcolor") }}
Sets the background color through color name or hexadecimal value.
{{ htmlattrdef("direction") }}
Sets the direction of the scrolling within the marquee. Possible values are left, right, up and down. If no value is specified, the default value is left.
{{ htmlattrdef("height") }}
Sets the height in pixels or percentage value.
{{ htmlattrdef("hspace") }}
Sets the horizontal margin
{{ htmlattrdef("loop") }}
Sets the number of times the marquee will scroll. If no value is specified, the default value is −1, which means the marquee will scroll continuously.
{{ htmlattrdef("scrollamount") }}
Sets the amount of scrolling at each interval in pixels. The default value is 6.
{{ htmlattrdef("scrolldelay") }}
Sets the interval between each scroll movement in milliseconds. The default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is specified.
{{ htmlattrdef("truespeed") }}
By default, scrolldelay values lower than 60 are ignored. If truespeed is present, those values are not ignored.
{{ htmlattrdef("vspace") }}
Sets the vertical margin in pixels or percentage value.
{{ htmlattrdef("width") }}
Sets the width in pixels or percentage value.

Event handlers

{{ htmlattrdef("onbounce") }}
Fires when the marquee has reached the end of its scroll position. It can only fire when the behavior attribute is set to alternate.
{{ htmlattrdef("onfinish") }}
Fires when the marquee has finished the amount of scrolling that is set by the loop attribute. It can only fire when the loop attribute is set to some number that is greater than 0.
{{ htmlattrdef("onstart") }}
Fires when the marquee starts scrolling.

Methods

start
Starts scrolling of the marquee.
stop
Stops scrolling of the marquee.

Examples

<marquee>This text will scroll from right to left</marquee>

<marquee direction="up">This text will scroll from bottom to top</marquee>

<marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid">
  <marquee behavior="alternate">
    This text will bounce
  </marquee>
</marquee>

{{EmbedLiveSample("Examples", 600, 400)}}

Notes

  • The marquee element is originally an IE invention.
  • The marquee element is not valid according to the HTML or XHTML specifications. Page authors concerned with validation should not use this tag.
  • The marquee element is implemented in Mozilla (Firefox) by using an XBL binding; see {{ source("/layout/style/xbl-marquee/xbl-marquee.xml") }}.

Compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{ CompatGeckoDesktop("1.0") }} 2.0 7.2 1.2
truespeed attribute {{ CompatNo() }} {{ CompatGeckoDesktop("1.9") }} 4.0 {{ CompatNo() }} {{ CompatNo() }}
hspace/vspace attribute {{ CompatUnknown() }} {{ CompatGeckoDesktop("1.9") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
loop attribute {{ CompatUnknown() }} {{ CompatGeckoDesktop("1.9") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatGeckoMobile("1.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
truespeed attribute {{ CompatUnknown() }} {{ CompatGeckoMobile("1.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
hspace/vspace attribute {{ CompatUnknown() }} {{ CompatGeckoMobile("1.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
loop attribute {{ CompatUnknown() }} {{ CompatGeckoMobile("1.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
{{ HTML:Element_Navigation() }}

Revision Source

<div>
  {{ non-standard_header() }}</div>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The HTML <code>&lt;marquee&gt;</code> element is used to insert a scrolling area of text.</p>
<h2 id="Attributes">Attributes</h2>
<dl>
  <dt>
    {{ htmlattrdef("behavior") }}</dt>
  <dd>
    Sets how the text is scrolled within the marquee. Possible values are <code>scroll</code>, <code>slide</code> and <code>alternate</code>. If no value is specified, the default value is <code>scroll</code>.</dd>
  <dt>
    {{ htmlattrdef("bgcolor") }}</dt>
  <dd>
    Sets the background color through color name or hexadecimal value.</dd>
  <dt>
    {{ htmlattrdef("direction") }}</dt>
  <dd>
    Sets the direction of the scrolling within the marquee. Possible values are <code>left</code>, <code>right</code>, <code>up</code> and <code>down</code>. If no value is specified, the default value is <code>left</code>.</dd>
  <dt>
    {{ htmlattrdef("height") }}</dt>
  <dd>
    Sets the height in pixels or percentage value.</dd>
  <dt>
    {{ htmlattrdef("hspace") }}</dt>
  <dd>
    Sets the horizontal margin</dd>
  <dt>
    {{ htmlattrdef("loop") }}</dt>
  <dd>
    Sets the number of times the marquee will scroll. If no value is specified, the default value is −1, which means the marquee will scroll continuously.</dd>
  <dt>
    {{ htmlattrdef("scrollamount") }}</dt>
  <dd>
    Sets the amount of scrolling at each interval in pixels. The default value is 6.</dd>
  <dt>
    {{ htmlattrdef("scrolldelay") }}</dt>
  <dd>
    Sets the interval between each scroll movement in milliseconds. The default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead, unless<code> truespeed </code>is specified.</dd>
  <dt>
    {{ htmlattrdef("truespeed") }}</dt>
  <dd>
    By default,<code> scrolldelay </code>values lower than 60 are ignored. If<code> truespeed </code>is present, those values are not ignored.</dd>
  <dt>
    {{ htmlattrdef("vspace") }}</dt>
  <dd>
    Sets the vertical margin in pixels or percentage value.</dd>
  <dt>
    {{ htmlattrdef("width") }}</dt>
  <dd>
    Sets the width in pixels or percentage value.</dd>
</dl>
<h2 id="Event_handlers" name="Event_handlers">Event handlers</h2>
<dl>
  <dt>
    {{ htmlattrdef("onbounce") }}</dt>
  <dd>
    Fires when the marquee has reached the end of its scroll position. It can only fire when the behavior attribute is set to <code>alternate</code>.</dd>
  <dt>
    {{ htmlattrdef("onfinish") }}</dt>
  <dd>
    Fires when the marquee has finished the amount of scrolling that is set by the loop attribute. It can only fire when the loop attribute is set to some number that is greater than 0.</dd>
  <dt>
    {{ htmlattrdef("onstart") }}</dt>
  <dd>
    Fires when the marquee starts scrolling.</dd>
</dl>
<h2 id="Methods" name="Methods">Methods</h2>
<dl>
  <dt>
    start</dt>
  <dd>
    Starts scrolling of the marquee.</dd>
  <dt>
    stop</dt>
  <dd>
    Stops scrolling of the marquee.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: html">
&lt;marquee&gt;This text will scroll from right to left&lt;/marquee&gt;

&lt;marquee direction="up"&gt;This text will scroll from bottom to top&lt;/marquee&gt;

&lt;marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"&gt;
  &lt;marquee behavior="alternate"&gt;
    This text will bounce
  &lt;/marquee&gt;
&lt;/marquee&gt;</pre>
<p>{{EmbedLiveSample("Examples", 600, 400)}}</p>
<h2 id="Notes" name="Notes">Notes</h2>
<ul>
  <li>The marquee element is originally an IE invention.</li>
  <li>The marquee element is not valid according to the HTML or XHTML specifications. Page authors concerned with validation should not use this tag.</li>
  <li>The marquee element is implemented in Mozilla (Firefox) by using an <a href="/en-US/docs/XBL" title="XBL">XBL</a> binding; see {{ source("/layout/style/xbl-marquee/xbl-marquee.xml") }}.</li>
</ul>
<h2 id="Compatibility" name="Compatibility">Compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>2.0</td>
        <td>7.2</td>
        <td>1.2</td>
      </tr>
      <tr>
        <td><code>truespeed</code> attribute</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("1.9") }}</td>
        <td>4.0</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>hspace/vspace</code> attribute</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("1.9") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td><code>loop</code> attribute</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("1.9") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td><code>truespeed</code> attribute</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td><code>hspace/vspace</code> attribute</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
      <tr>
        <td><code>loop</code> attribute</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.0") }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div>
  {{ HTML:Element_Navigation() }}</div>
Revert to this revision