Open In App

HTML Marquee direction attribute

Last Updated : 12 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

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 depreciated from 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 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

Supported Browsers:

  • Google Chrome 1
  • Edge 12
  • Firefox 65
  • Apple Safari 7.2
  • Opera 1.2 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads