Creating Scrolling Text with the Marquee Tag in HTML


The <marquee> tag in HTML is used to create a scrolling text or an image. It is an HTML element that is used to scroll certain text or image across a web page. The tag was first introduced in the early versions of HTML and is now deprecated in HTML5.

The <marquee> tag can be used to create scrolling text, images, or other content that moves horizontally or vertically across the web page. It is a non-standard HTML element and is not supported by all web browsers.

Attributes of the <marquee> tag include:

  • direction: Specifies the direction of the scrolling content. The values can be left, right, up, or down .
  • behavior: Specifies the scrolling behavior. The values can be scroll, slide, or alternate .
  • bgcolor: Specifies the background color of the scrolling content.
  • height and width: Specifies the height and width of the scrolling content.
  • scrollamount: Specifies the speed of the scrolling content.
  • loop: Specifies the scrolling content moving count.

The Marquee Tag is not recommended to use because it is not supported by many modern web browsers and it can make the website less accessible to users. Other ways to create scrolling text or images are by using CSS or JavaScript.

Source Code

<html>
  <head>
    <title>Tutor Joes</title>
  </head>
  <body>
    <h1>Marquee Tag in HTML</h1>
    <marquee bgcolor="orange" height="100px" width="300px" behavior="alternate" 
     direction="left">
	Tutor Joes
    </marquee>
  </body>
</html>
To download raw file Click Here

The code you provided creates an HTML document that has a heading "Marquee Tag in HTML" and a scrolling text within a marquee tag. The marquee tag is used to create a scrolling text or an image.

In this code, the bgcolor attribute is set to "orange" which sets the background color of the marquee to orange. The height attribute is set to "100px" and width attribute is set to "300px" which sets the height and width of the marquee. The behavior attribute is set to "alternate" which causes the text to alternate back and forth within the marquee. The direction attribute is set to "left" which causes the text to scroll from right to left. The text inside the marquee tag is "Tutor Joes".

It's worth noting that the Marquee tag is considered as deprecated and it's not recommended to use it in new development due to its non-standard and accessibility issues.

In conclusion, the above code demonstrates the use of the HTML <marquee> tag, which is used to create scrolling text or images on a web page. The tag is represented by the <marquee> tag, and it is set to scroll left in an alternating manner. The background color of the marquee is set to orange, the height is set to 100px, and the width is set to 300px. The text within the tag is "Tutor Joes". It should be noted that the <marquee> tag is no longer considered a standard in HTML and its use is not recommended in modern web development. So, it's better to avoid using it.