1 文字滚动
标签为:<marguee></marguee>
,格式为:
<marquee behavior="滚动方式" direction="滚动方向" scrollamount="滚动速度">滚动文字</marquee>
属性 | 取值 | 含义 |
---|---|---|
direction | left right up down | 默认值,向左滚动 向右滚动 向上滚动 向下滚动 |
behavior | scroll slide | 默认值,循环滚动 只滚动一次,不重复滚动 |
width、height | 设置滚动范围 |
例如,.html文件中代码如下:
<marquee behavior="slide" direction="up" scrollamount="1" height="200" width="200">橘猫吃不胖</marquee>
2 图片滚动
格式为:
<marquee behavior="滚动方式" direction="滚动方向" scrollamount="滚动速度">
<img src="图片的地址" alt="">
</marquee>