Course Content
HTML Introduction
0/1
HTML Editors
0/1
HTML Basic Tags
0/1
HTML Elements
0/1
HTML Attributes
0/1
HTML Headings
0/1
HTML Paragraph
0/1
HTML Text Formatting
0/1
HTML Meta Tags
0/1
HTML Quotations
0/1
HTML Comments
0/1
HTML Images
0/1
HTML Background
0/1
HTML Colors
0/1
HTML Lists
0/1
HTML Tables
0/1
HTML Forms
0/1
HTML Spell Check
0/1
HTML Media
0/1
HTML Marquees
0/1
HTML CSS
0/1
HTML Links
0/1
HTML Block & Inline
0/1
HTML Classes
0/1
HTML Id
0/1
HTML I frames
0/1
HTML Java script
0/1
HTML File paths
0/1
HTML Layout
0/1
HTML Responsive
0/1
HTML Computer Code
0/1
HTML Tutorial
About Lesson

HTML Marquee Element

In this tutorial, we will learn about marquee tag and its attribute in HTML with the help of examples.


<marquee> Tag

The marquee element is a container tag of HTML.
It scrolls the content inside it either from horizontally (left to right or right to left) or vertically (top to bottom or bottom to top).
By default, the text inside the <marquee> tag will scroll from right to left. It has both an opening and closing tag.

Note : The <marquee> tag has been deprecated (no longer in use) in HTML 5.


<marquee> Tag Attributes

There are some attributes which can be used in <marquee> tag :

Attribute Description
direction It specifies the direction of scrolling the content
bgcolor It specifies the background color of the marquee
width It defines the width of a marquee
height It defines the height of a marquee
hspace It specifies the horizontal space around the marquee
vspace It specifies the vertical space around the marquee
loop It specifies how many times content moves

Example :

<!DOCTYPE html>
<html>
  <head>
    <title>Marquee Tag Attribute</title>
  </head>
  <body>
    <marquee>This is a simple marquee tag.</marquee>
    <marquee direction = "right" bgcolor = "#ff0000">This is
a marquee tag with direction attribute.</marquee>
    <marquee bgcolor = "#ffa500">This is a marquee tag with
bgcolor attribute.</marquee>
    <marquee width = "300px" bgcolor = "#ffff00">This is a
marquee tag with width attrbiute.</marquee>
    <marquee height = "50px" bgcolor = "#008000">This is a
marquee tag with height attribute.</marquee>
    <marquee hspace = "50px" bgcolor = "#0000ff">This is a
marquee tag with hspace attribute.</marquee>
    <marquee vspace = "50px" bgcolor = "#4b0082">This is a
marquee tag with vspace attribute.</marquee>
    <marquee loop = "5" bgcolor = "#ee82ee">This is a marquee
tag with loop attribute.</marquee>
  </body>
</html>

Output

This is a simple marquee tag.
This is a marquee tag with direction attribute.
This is a marquee tag with bgcolor attribute.
This is a marquee tag with width attrbiute.
This is a marquee tag with height attribute.
This is a marquee tag with hspace attribute.
This is a marquee tag with vspace attribute.
This is a marquee tag with loop attribute.

 

error: Content is protected !!