HTML - <marquee> in HTML

What is <marquee> in HTML?

<marquee> is a non-standard HTML tag used to create scrolling text or images across a web page. It's mostly used for visual effects like moving headlines or announcements. However, it is deprecated in HTML5, meaning it's not recommended for modern websites and may not be supported in all browsers.

5 Attributes of <marquee>

  1. direction

    • Purpose: Sets the direction of the scroll.

    • Values: "left" (default), "right", "up", "down"

    • Example: <marquee direction="right">Scrolling Text</marquee>

  2. behavior

    • Purpose: Defines how the marquee scrolls.

    • Values:

      • "scroll" – Scrolls in one direction and loops.

      • "slide" – Scrolls in one direction and stops.

      • "alternate" – Bounces back and forth.

    • Example: <marquee behavior="alternate">Bouncing Text</marquee>

  3. scrollamount

    • Purpose: Controls the speed of scrolling.

    • Values: A number (higher = faster)

    • Example: <marquee scrollamount="10">Fast Scroll</marquee>

  4. loop

    • Purpose: Sets how many times the marquee scrolls.

    • Values: A number or "infinite"

    • Example: <marquee loop="3">Scroll 3 Times</marquee>

  5. bgcolor

    • Purpose: Sets the background color of the marquee area.

    • Values: Any color name or hex code.

    • Example: <marquee bgcolor="yellow">Colored Background</marquee>

 

  • The <marquee> tag is not supported in HTML5 standards.

  • Modern alternatives include CSS animations and JavaScript.

  • It is still functional in some browsers but should be avoided in professional or accessible websites.