marquee的标签内容的对齐方式:
absbottom:绝对底部对齐(与g、p等字母的最下端对齐)
absmiddle:绝对中央对齐
baseline:底线对齐
bottom:底部对齐(默认)
left:左对齐
middle:中间对齐
right:右对齐
texttop:顶线对齐
top:顶部对齐
behavior属性:
表示文字滚动方式
属性的参数值:
alternate 表示内容来回滚动
scroll 表示内容单方向循环滚动
slide 表示内容只滚动一次
代码如下
- <marquee behavior="alternate">回滚动</marquee>
- <marquee behavior="scroll">单方向(一行)循环滚动</marquee>
- <marquee behavior="slide" >向上只滚动一次了</marquee>
- <marquee scrollamount="100">我速度很快.</marquee>
- <marquee behavior="scroll" direction="down" height="30">改单方向向下循环滚动</marquee>
direction属性
表示内容滚动的方向
属性的参数值有down、left、right、up
代码如下
- <marquee behavior="scroll" direction="down" height="30">改单方向向下循环滚动</marquee>
bgcolor属性:
表示文字滚动范围的背景颜色
代码如下
- <marquee behavior="slide" direction="right" bgcolor="olive">欢迎光临</marquee>
- <marquee bgcolor="peachpuff">欢迎光临</marquee>
scrollamount属性:
决定文字滚动的速度
数值可以是正负数,0表示静止
代码如下
- <marquee scrollamount="0">我速度很快.</marquee>
- <marquee scrollamount="3">我速度很快.</marquee>
- <marquee scrollamount="-2">我速度很快.</marquee>
scrolldelay属性
决定文字滚动的速度
数值可以是正负数,0不表示静止
代码如下
- <marquee loop="2">我滚动2次。</marquee>
- <marquee loop="infinite">我无限循环滚动。</marquee>
- <marquee loop="-1">我无限循环滚动。</marquee>
loop属性:
决定滚动文字的滚动次数
缺省是无限循环。
如果设置参数值为-1或infinite时将无限循环。
代码如下
- <marquee loop="2">我滚动2次。</marquee>
- <marquee loop="infinite">我无限循环滚动。</marquee>
- <marquee loop="-1">我无限循环滚动。</marquee>
hspace和vspace属性
定滚动矩形区域距周围的空白区域
width和height属性 :
代码如下
οnmοuseοver=this.stop()
表示当鼠标以上区域的时候滚动停止
代码如下
- <marquee width="300" height="30" vspace="10" hspace="10" bgcolor="red">矩形边缘水。</marquee>
- <marquee width="300" height="30" vspace="50" hspace="50" bgcolor="red">矩形边缘水平。</marquee>
οnmοuseοut=this.start()
当鼠标移开的时候又继续滚动。
代码如下
- <marquee onMouseOut="this.start()" onMouseOver="this.stop()">onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动 onMouseOver="this.stop()":
- 用来设置鼠标移入该区域时停止滚动</marquee>