HTML Marquee direction attribute

Last Updated : 17 Jun, 2025

The Marquee direction attribute in HTML is used to set the direction of scrolling. The default direction of scrolling is left. Possible values are up, down, left, and right.

Note: This attribute is deprecated in HTML5.

Syntax: 

<marquee direction= up | down | left | right> 

Attribute Value : 

Attribute Value

Description

up

It sets the direction to upward.

down

It sets the direction downward.

left

It sets the direction to the left. It has a default value.

right

It sets the direction to the right.

Example: In this example, we will see the implementation of the marquee direction attribute with an example.

html
<!DOCTYPE html>
<html>

<head>
    <title>HTML Marquee direction attribute
</title>
    <style>
        .main {
            text-align: center;
        }
        
        .marq {
            padding-top: 30px;
            padding-bottom: 30px;
        }
    </style>
</head>

<body>
    <h1 style="color:green; text-align:center;">
      GeeksforGeeks
  </h1>
    <div class="main">
        <marquee class="marq" 
                 bgcolor="Green" 
                 direction="left"
                 loop="">
            Left
        </marquee>
        <marquee class="marq"
                 bgcolor="Green"
                 direction="right" 
                 loop="">
            Right
        </marquee>
    </div>
</body>

</html>

Output: 

Example 2: In this example we will see the implementation of marquee direction attribute with another example.

HTML
<!DOCTYPE html>
<html>

<head>
    <title>HTML Marquee direction attribute
    </title>
    <style>
        .main {
            text-align: center;
        }

        marquee {
            text-align: center;
        }

        .marq {
            padding-top: 30px;
            padding-bottom: 30px;
        }
    </style>
</head>

<body>
    <h1 style="color:green; text-align:center;">
        GeeksforGeeks
    </h1>
    <div class="main">
        <marquee class="marq" bgcolor="Green" 
                 direction="up" loop="">
            Left
        </marquee>
        <marquee class="marq" bgcolor="Green" 
                 direction="down" loop="">
            Right
        </marquee>
    </div>
</body>

</html>

Output:

aaz

Browser Support

AttributeChromeEdgeFirefoxSafariOpera
Marquee Direction
Desktopv1v12v1v1v15
Mobilev18v4v1v14
Comment