HTML <marquee> tag

Updated: 09/12/2023 by Computer Hope
HTML marquee tag

When writing in HTML (hypertext markup language), the <marquee> tag is a block element used to designate an area containing scrolling text or a scrolling image. This area is in a line by default, but can be changed to a box utilizing attributes. The following sections contain information about this tag, including examples of it in use, and related attributes and browser compatibility.

Example scrolling text code

<marquee>This sentence should scroll from right to left.</marquee>
<marquee direction="down">This sentence should scroll from top to bottom.</marquee>

Example scrolling text result

This sentence should scroll from right to left. This sentence should scroll from top to bottom.

Example scrolling image code

<marquee direction="right"><img src="home.png" alt="Home"></marquee>

Example scrolling image result

White two-story house.

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <marquee> tag has the following unique attributes.

Attribute Description
behavior Designates how the text should scroll in the marquee.
bgcolor Designates a background color for the marquee.
direction Designates the scrolling direction of the text within a marquee.
height Designates the height of the scrolling area.
hspace Designates a horizontal margin.
loop Designates how often the text within a marquee should scroll.
scrollamount Designates how fast the text should scroll.
scrolldelay Designates how long in-between each text scrolling.
truespeed Sets the scrollamount to ignore values lower than 60.
vspace Designates a vertical margin.
width Designates the width of a marquee.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions 2.0+ All versions 1.2+ 7.2+ All versions

Browser, Compatibility, Container tag, Marquee, Scroll, Web design terms