HTML Marquee scrollamount实例讲解

时间:2022-04-06
本文章向大家介绍HTML Marquee scrollamount实例讲解,主要分析其语法、参数、返回值和注意事项,并结合实例形式分析了其使用技巧,希望通过本文能帮助到大家理解应用这部分内容。

HTML中的Marquee scrollamount属性用于设置每个间隔的滚动量(以像素为单位)。选取框的默认速度为6。

用法:

<marquees scrollamount=number >

属性值:



  • Number:定义速度值。

例:

<!DOCTYPE html> 
<html> 
  
<head> 
    <title>Marquee Tag</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=""> 
            scrollamount:default(6) 
        </marquee> 
        <marquee class="marq"
                 Scrollamount=10 
                 bgcolor="Green" 
                 direction="left" 
                 loop=""> 
            scrollamount:10 
        </marquee> 
    </div> 
</body> 
  
</html>

输出:

支持的浏览器:下面列出了HTML Marquee scrollamount属性支持的浏览器:

  • 谷歌浏览器
  • IE浏览器
  • Firefox
  • 苹果Safari
  • Opera