MARQUEE IN HTML

  • The HTML <marquee> tag is an element used to create scrolling text or images horizontally or vertically wuthin a web page.

  • Example of Marquee Tag :
  • <!DOCTYPE html> <html> <head> <title></title> </head> <body> <marquee>PBA INSTITUTE</marquee> </body> </html>
    Output :
    PBA INSTITUTE

  • Different Types of Marquee Tag :
  • Direction Marquee :
  • Direction marquee refers to the scrolling direction of content within a <marquee> element in HTML.
    The direction attribute of the <marquee> element determines the determines the direction in which the content scrolls.
    The direction attribute can have the following values :
    left : Scrolls the content from right to left.
    right : Scrolls the content from left to right.
    up : Scrolls the content from bottom to top.
    down : Scrolls the content from top to bottom.

    Direction Marquee Code
    <!DOCTYPE html> <html> <head> <title></title> </head> <body> <marquee direction="right">PBA COMPUTER INSTITUTE</marquee> </body> </html>

    Output:

    PBA COMPUTER INSTITUTE


  • Marquee behavior :
  • Marquee behavior refers to the way in which content moves within a marquee element on a webpage.
    Common behaviors include scrolling, sliding, or alternating directions.

    Marquee Behavior Code
    <html> <body> <marquee direction="down" width="200" height="150" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> PBA INSTITUTE </marquee> </marquee> </body> </html>

    Output:

    PBA INSTITUTE


  • Marquee Background Color :
  • The background color around a <marquee> element can improve readability, highlight important information, and contribute to the overall visual appeal of the webpage.

    Marquee Background color Code
    <html> <body> <marquee bgcolor=tomato width=200 height=20> PBA INSTITUTE </marquee> </body> </html>

    Output :

    PBA INSTITUTE


  • Marquee Scrollamount :
  • The scrollamount attribute in the <marquee> tag specifies the scrolling speed or distance of the text within the marquee.
    It determines how fast or slow the text moves across the screen.
    The value of the scrollamount attribute is in pixels per iteration.

    Marquee Scrollamount
    <html> <body> <marquee bgcolor=orange width=200 height=20 direction=right behavior=alternate scrollamount=10> PBA INSTITUTE</marquee> </body> </html>

    Output:

    PBA INSTITUTE