HTML Marquee Direction: Left, Right, Up and Down

The legacy <marquee> element uses the direction attribute to choose the movement direction. The historical values are left, right, up, and down. If direction is omitted, the usual default is left.

For new pages: <marquee> is obsolete and should not be used in new HTML. The examples below remain useful when maintaining older pages, followed by modern CSS alternatives.
<marquee direction="left">Scrolling text</marquee>
HTML marquee tag to scroll or alternate text or image on web page with various speed and direction

Marquee Direction: Left Top ↑

direction="left" moves the content from right to left. This is also the normal default direction when the attribute is omitted.

This is an example of Marquee (Direction: Left)
<marquee direction="left">
This is an example of Marquee
</marquee>

direction="right" moves the content from left to right.

This is an example of Marquee (Direction: Right)
<marquee direction="right">
This is an example of Marquee
</marquee>

Marquee Direction: Up Top ↑

direction="up" moves the content vertically upward. A fixed height was commonly used on old pages to define the visible marquee area.

This is an example of Marquee direction = up
<marquee direction="up" height="80">
This is an example of Marquee direction = up
</marquee>

Marquee Direction: Down Top ↑

direction="down" moves the content vertically downward.

This is an example of Marquee direction = down
<marquee direction="down" height="80">
This is an example of Marquee direction = down
</marquee>
Legacy note: older marquee examples often combine direction with presentational attributes such as bgcolor, height, or inline font styling. These may still appear in old code, but CSS should control presentation in new work.

Modern CSS Alternative for Directional Movement Top ↑

For new projects, use semantic HTML and CSS animation. The movement direction comes from the start and end values used in transform: translateX() or translateY().

Left and right movement Top ↑

<div class="ticker">
  <p class="move-left">Moving from right to left</p>
</div>

<style>
.ticker { overflow: hidden; }
.move-left {
  white-space: nowrap;
  animation: moveLeft 8s linear infinite;
}
@keyframes moveLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}
</style>

For movement in the opposite direction, swap the transform values:

@keyframes moveRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

Up and down movement Top ↑

Vertical movement uses translateY() in the same way:

@keyframes moveUp {
  from { transform: translateY(100%); }
  to { transform: translateY(-100%); }
}

@keyframes moveDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(100%); }
}

Accessibility and Motion Top ↑

Automatically moving content can be distracting and may be difficult for some users to read. Important information should remain available even when animation is disabled, and essential controls should not depend on motion.

Respect the user's reduced-motion preference when animation is not essential:

@media (prefers-reduced-motion: reduce) {
  .move-left, .move-right, .move-up, .move-down {
    animation: none;
  }
}

Common Marquee Direction Mistakes Top ↑

Using marquee on a new website Top ↑

Keep <marquee> only for maintaining legacy pages. Use CSS animation when directional movement is truly needed.

Using obsolete presentation attributes Top ↑

Do not rely on bgcolor, old alignment attributes, or other presentational HTML. Use CSS.

Moving essential text continuously Top ↑

Users should not have to chase important information across the screen. Prefer static content or provide a way to pause motion when animation is necessary.

Confusing direction with speed Top ↑

direction changes where marquee content moves. Legacy scrollamount and scrolldelay affect movement speed instead.

Frequently Asked Questions Top ↑

Q1: What values can the marquee direction attribute use?

The legacy values are left, right, up and down.

Q2: What is the default marquee direction?

The usual default is left when the direction attribute is omitted.

Q3: Is the HTML marquee tag still recommended?

No. Marquee is obsolete and should not be used for new HTML. CSS animation is the modern alternative.

Q4: How do I move content from right to left with CSS?

Animate transform from translateX(100%) to translateX(-100%) inside an overflow-hidden container.

Q5: How do I create vertical movement without marquee?

Use a CSS animation with translateY() to move the element upward or downward.

Q6: How should I handle users who prefer less motion?

Use the prefers-reduced-motion media query to disable or simplify non-essential animation.


HTML Marquee Tag Marquee Scroll Speed Marquee Repeat



plus2net.com







sabir malik

02-02-2012

very nice effort
Mayesh Mohapatra

22-11-2013

Very Very Useful for students like me
varun

03-03-2014

How to change text color when mouse hover
shahid

26-10-2014

very nice tips about marquu thanks
Friday Moses

27-04-2015

I am happy to arrive at this tutorial site, may God bless u for this wonderful support for new commers like me.
ABDULLAH WASEER

11-09-2015

learn to good
got a good idea
Deepak Prasad

04-11-2015

Is it possible to move marquee in multiple directions and not a straight line
Uche E

02-09-2016

dont we have a zig zag direction for marquee?
smo1234

03-09-2016

There is no zig zag in direction but you can keep two marquee tags one after the other and give them opposite directions. You can match their speed to give cross effect.
MAHESH KUMAR

17-11-2016

Very nice tips,about marquee.Very very thanks sir.................
divya

31-10-2018

can i set multiple direction in marquee tag? and in each direction can in set different timings?
smo1234

31-10-2018

May be by using DOM this can be done, by using simple HTML not possible.

19-01-2022

its very usefull



We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2026   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer