详解html中的marquee属性

2019-01-15 08:32:20王冬梅

alternate: 表示在两端之间来回滚动。

scroll: 表示由一端滚动到另一端,会重复。

slide:  表示由一端滚动到另一端,不会重复。

<marquee behavior="alternate">alternate:表示在两端之间来回滚动。 </marquee> <marquee behavior="scroll">scroll:表示由一端滚动到另一端,会重复。</marquee> <marquee behavior="slide">slide: 表示由一端滚动到另一端,不会重复。</marquee>

bgcolor

设定活动字幕的背景颜色,背景颜色可用RGB、16进制值的格式或颜色名称来设定。

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

direction

设定活动字幕的滚动方向

<marquee direction="down">设定活动字幕的滚动方向direction="down":向下</marquee> <marquee direction="left">设定活动字幕的滚动方向direction="left":向左</marquee> <marquee direction="right">设定活动字幕的滚动方向direction="right":向右</marquee> <marquee direction="up">设定活动字幕的滚动方向direction="up":向上</marquee>

height

设定活动字幕的高度

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

width

设定活动字幕的宽度

<marquee width="500" bgcolor="#CCCCCC">设定活动字幕的宽度width="500"</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>