Marquee HTML

The Marquee HTML tag is a non-standard HTML element which is used to scroll a image or text horizontally or vertically.

In simple words, you can say that it scrolls the image or text up, down, left or right automatically.

Marquee tag was first introduced in early versions of Microsoft’s Internet Explorer. It is compared with Netscape’s blink element.

Marquee HTML Example

<marquee>This is an example of html marquee </marquee> 

Output:This is an example of html marquee


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<marquee>YesYesYesYesYes

HTML Marquee Attributes

Marquee’s element contains several attributes that are used to control and adjust the appearance of the marquee.

AttributeDescription
behaviorIt facilitates user to set the behavior of the marquee to one of the three different types: scroll, slide and alternate.
directiondefines direction for scrolling content. It may be left, right, up and down.
widthdefines width of marquee in pixels or %.
heightdefines height of marquee in pixels or %.
hspacedefines horizontal space in pixels around the marquee.
vspacedefines vertical space in pixels around the marquee.
scrolldelaydefines scroll delay in seconds.
scrollamountdefines scroll amount in number.
loopdefines loop for marquee content in number.
bgcolordefines background color. It is now deprecated.

HTML Scroll Marquee

It is a by default property. It is used to scroll the text from right to left, and restarts at the right side of the marquee when it is reached to the end of left side. After the completion of loop text disappears.

 

    <marquee width="100%" behavior="scroll" bgcolor="pink">  
    
    This is an example of a scroll marquee...  
    
    </marquee>

    Output:This is an example of a scroll marquee…

    HTML Slide Marquee

    In slide marquee, all the contents to be scrolled will slide the entire length of marquee but stops at the end to display the content permanently.

      

      <marquee width="100%" behavior="slide" bgcolor="pink">  
      
      This is an example of a slide marquee...  
      
      </marquee>

      Output:This is an example of a slide marquee…

      HTML Alternate Marquee

      It scrolls the text from right to left and goes back left to right.

      <marquee width="100%" behavior="alternate" bgcolor="pink">  
      
      This is an example of a alternate marquee...  
      
      </marquee>

      Output:This is an example of a alternate marquee…

      Direction in HTML marquee

      This is used to change the direction of scrolling text. Let’s take an example of marquee scrolling to the right. The direction can be left, right, up and down.

      <marquee width="100%" direction="right">  
      
       This is an example of a right direction marquee...  
      
      </marquee>

      Output:This is an example of a right direction marquee…

      Nested marquee example

      <marquee width="400px" height="100px" behavior="alternate" style="border:2px solid red">  

      <marquee behavior="alternate">  

      Nested marquee...  

      </marquee>  

      </marquee>

       

        Comments

        Leave a Reply

        Your email address will not be published. Required fields are marked *