HTML <marquee> tag

Updated: 10/11/2017 by Computer Hope

HTML marquee tagWhen writing in HTML, the <marquee> tag is a block element used to designate an area that contains 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, as well as 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.jpg" alt="Home"></marquee>

Example scrolling image result



Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all of the current unique HTML attributes for the <marquee> tag, as well as a description of each.

Attribute Description
behavior Designates how the text should scroll within 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 many times 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


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

Browser, Compatibility, Marquee, Scroll, Web design terms