![]() |
VOOZH | about |
The <marquee> tag in HTML allows you to create scrolling effects for images, making it a simple way to add dynamic movement to your webpage. Images can scroll horizontally or vertically, with various attributes controlling the direction and behavior of the movement.
<marquee>
<img src="image.jpg" alt="Scrolling Image">
</marquee>
The <marquee> tag supports several attributes that define the scrolling behavior:
Attributes | Description |
|---|---|
Sets the direction for the scrolling images. The value of this attribute can be left, right, up, or down. | |
The behavior tells about how the text scrolls. It can be one of the following values which are alternate, scroll, slide, etc. |
In this example, we will use the <marquee> tag to move images. The first image will scroll from right to left, while the second image will scroll vertically upwards.
Output:
Here, we will demonstrate how to use the behavior="alternate" attribute to make the images move back and forth within the <marquee> container.
Output: