Online Certificate Courses

What is an HTML Marquee

An HTML marquee may be a scrollable text that's often rendered either horizontally across or vertically down your HTML webpage counting on the settings you've got specified. this is often made by using <marquee> HTML tag.

Note − The <marquee> tag deprecated in HTML5. Do not use this element, instead you can use JavaScript and CSS to create such effects.

Syntax

This is a simple syntax to show how to use HTML <marquee> tag is as follows:

<marquee attribute_name = "attribute_value"....more attributes>
   One or more lines or text message or image
</marquee>

The <marquee> Tag Attributes

The following is the list of important attributes that can be used with <marquee> tag.

1. width: This specifies the width of the marquee. This can be a value like 10 or 20% etc.

2. height: This specifies the height of the marquee. This can be a value like 10 or 20% etc.

3. direction: This specifies the direction in which marquee should scroll. This can be a value like up, down, left or right.

4. behavior: This specifies the type of scrolling of the marquee. This can have a value like a scroll, slide, and alternate.

5. scrolldelay: This specifies how long to delay between each jump. This will have a value like 10 etc.

6. scrollamount: This specifies the speed of marquee text. This can have a value like 10 etc.

7. loop: This specifies how many times to loop. The default value is INFINITE, which means that the marquee loops endlessly.

8. bgcolor: This specifies background color in terms of color name or color hex value.

9. hspace: This specifies horizontal space around the marquee. This can be a value like 10 or 20% etc.

10. vspace: This specifies vertical space around the marquee. This can be a value like 10 or 20% etc.

Below are a few examples to show how to use the marquee tag.

Examples - 1

<!DOCTYPE html>
<html>
   <head>
      <title>HTML marquee Tag</title>
   </head>
   <body>
      <marquee>This is basic example of marquee</marquee>
   </body>	
</html>

Examples - 2

<!DOCTYPE html>
<html>

   <head>
      <title>HTML marquee Tag</title>
   </head>
	
   <body>
      <marquee width = "50%">This example will take only 50% width</marquee>
   </body>
	
</html>

Example - 3

<!DOCTYPE html>
<html>

   <head>
      <title>HTML marquee Tag</title>
   </head>

   <body>
      <marquee direction = "right">This text will scroll from left to right</marquee>
   </body>
	
</html>

Example -4

<!DOCTYPE html>
<html>

   <head>
      <title>HTML marquee Tag</title>
   </head>
	
   <body>
      <marquee direction = "up">This text will scroll from bottom to up</marquee>
   </body>
	
</html>

 


90% Scholarship Offer!!

The Scholarship offer is a discount program to take our Course Programs and Certification valued at $70 USD for a reduced fee of $7 USD. - Offer Closes Soon!!

Copyrights © 2021. SIIT - Scholars International Institute of Technology is a subsidiary of Scholars Global Tech. All Rights Reserved.