Open In App

HTML Marquee scrollamount attribute

Last Updated : 29 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The Marquee scrollamount attribute in HTML is used to set the amount of scrolling at each interval in pixels. The default speed of the marquee value is 6. It moves the content by displaying it, then delaying it for some short period, and then displaying the content again in a new position.

Note: This attribute is depreciated from HTML5.

Syntax: 

<marquee scrollamount=number >

Attribute value: 

Attribute Value

Description

Number

It defines the speed value.

Example: The implementation of scrollamount attribute

HTML
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <title>HTML marquee scrollamount attribute</title>
    <style>
        marquee {
            color: green;
            font-size: 50px;
        }
    </style>
</head>

<body>
    <marquee scrollamount="20">GeeksforGeeks</marquee>
</body>

</html>

Output:

gif3
scrollamount attribute Output

Example: The implementation of scrollamount attribute with default and custom value of the attribute.

html
<!DOCTYPE html>
<html>

<head>
    <title>HTML marquee scrollamount attribute</title>
    <style>
        h1 {
            color: green;
            text-align: center;
        }

        .main {
            text-align: center;
        }

        .marquee1 {
            padding-top: 30px;
            padding-bottom: 30px;
            background-color: Green;
            direction: left;
        }
    </style>
</head>

<body>
    <h1>GeeksforGeeks</h1>
    <div class="main">
        <marquee class="marquee1">
            scrollamount: default(6)
        </marquee>
        <marquee class="marquee1" scrollamount="10">
            scrollamount: 10
        </marquee>
    </div>
</body>

</html>

Output: 

gif4
scrollamount attribute with default and custom value Output

Supported Browsers:

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

Next Article

Similar Reads