HTML标签marquee

marquee语法
    <marquee></marquee>

实例一
<marquee>Hello, World</marquee>

marquee常用到的两个事件:
onMouseOut="this.start()" 当鼠标移出该区域时
onMouseOver="this.stop()" 当鼠标移入该区域时

实例二
<marquee onMouseOut="this.start()" onMouseOver="this.stop()">marquee常用到的两个事件</marquee>


下面开始说一下marquee所支持的属性


beha
vior 设定滚动的方式:
    alternate:来回滚动。

    scroll:   重复滚动。(默认效果)
    slide:    不重复滚动。

代码如下:

<marquee behavior="alternate">来回滚动。 </marquee>

<marquee behavior="scroll">重复滚动。</marquee>

<marquee behavior="slide">不重复滚动。</marquee>


bgcolor设定活动字幕的背景颜色。

代码如下:

<marquee bgcolor="#006699">设定活动字幕的背景颜色</marquee>

<marquee bgcolor="RGB(10%,50%,100%,)">设定活动字幕的背景颜色 </marquee>

<marquee bgcolor="red">设定活动字幕的背景颜色</marquee>


direction设定活动字幕的滚动方向

代码如下:

<marquee direction="down">设定活动字幕的滚动方向向下</marquee>

<marquee direction="left">设定活动字幕的滚动方向向左(默认效果)</marquee>

<marquee direction="right">设定活动字幕的滚动方向向右</marquee>

<marquee direction="up">设定活动字幕的滚动方向向上</marquee>


height设定活动字幕的高度

代码如下:

<marquee height="500" direction="down" bgcolor="#CCCCCC">设定活动字幕的高度</marquee>


width设定活动字幕的宽度

代码如下:

<marquee width="500" bgcolor="#CCCCCC">设定活动字幕的宽度</marquee>


loop设定滚动的次数,当loop=-1表示一直滚动下去,默认为-1

代码如下:

<marquee loop="-1" bgcolor="#CCCCCC">我会不停地走。</marquee>

<marquee loop="2" bgcolor="#CCCCCC">我只走两次哦</marquee>


scrollamount设定活动字幕的滚动速度,单位pixels

代码如下:

<marquee scrollamount="10" >scrollamount="10" </marquee>

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

<marquee scrollamount="30" >scrollamount="30" </marquee>


scrolldelay设定活动字幕滚动两次之间的延迟时间,单位millisecond(毫秒)

值大了会有一步一停顿的效果

代码如下:

<marquee scrolldelay="10" >scrolldelay="10" </marquee>

<marquee scrolldelay="100" > scrolldelay="100"</marquee>

<marquee scrolldelay="1000">scrolldelay="1000" </marquee>


hspace
     设定活动字幕里所在的位置距离父容器水平边框的距离
     This controls the horizontal(水平)space around the display box.
代码如下:
  <table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
           <tr>
              <td><marquee hspace="100" bgcolor="#CCCCCC">hspace="100"</marquee></td>
           </tr>
        </table>
 

      vspace
      设定活动字幕里所在的位置距离父容器垂直边框的距离
      This controls the vertical(垂直) space around the display box.
代码如下:
      <marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值