HTML <marquee> tag

You are Here:

HTML <marquee> tag

The <marquee> tag is used to scroll the text either vertically or horizontally.

Note: It is otherwise called as running text.

Warning: The <marquee> tag is deprecated and is no longer recommended.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <marquee>This text will scroll from right to left</marquee> <marquee direction="up" style="height:250px;">This text will scroll from bottom to top</marquee> </body> </html>

Attributes

AttributeValueExplanation
behavior
  • alternate
  • slide
  • scroll
Specifies how the text is scrolled within the marquee.
bgcolor
  • color name
  • #RRGGBB
Specifies the background color.
direction
  • left
  • right
  • up
  • down
Specifies the direction ofthe scrolling within the marquee.
heightpx/percentage valueSpecifies height width of the <marquee> element.
hspacepx/percentage valueSpecifies the horizontal spacing on either side.
loop
  • numeric value
  • infinite
Specifies the number of times the marquee will scroll. Default value is -1
scrollamountpxSpecifies the amount of scrolling at each interval in pixels. Default value is 6.
scrolldelaymillisecSpecifies the interval between each scroll movement in milliseconds.
truespeedmillisecBy default, scrolldelay values lower than 60 are ignored.
vspacepx/percentage valueSpecifies the vertical spacing on either side.
widthpx/percentage valueSpecifies the width of the <marquee> element.

Event Handlers

EventValueExplanation
onbouncescriptScript runs when the marquee has reached the end of its scroll position. works only when behavior=alternate
onfinishscriptScript runs when the marquee has finished the amount of scrolling that is set by the loop attribute.
onstartscriptScript runs when the marquee starts scrolling.

Methods

MethodValueExplanation
start()scriptIt starts scrolling of the marquee
stop()scriptIt stops scrolling of the marquee.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author