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.
<!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.
<!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:

Browser Support
| Attribute | |||||
|---|---|---|---|---|---|
| Marquee Direction | ✓ | ✓ | ✓ | ✓ | ✓ |
| Desktop | v1 | v12 | v1 | v1 | v15 |
| Mobile | v18 | ‐ | v4 | v1 | v14 |