天天看点

移动文字(marquee标签)w3c非标准

marquee标签:创建一个滚动的文本字幕,应用于文字、图片、表格。 基本语法:  <marquee>...</marquee> 属性汇总例句: <marquee direction=up behavior=scroll loop=3 scrollamount=1 scrolldelay=10 bgcolor=#ccffff height=150 width=15% hspace=20 vspace=10 onmouseover=this.stop() onmouseout=this.start()><P align=center>此处输入滚动内容</P></marquee> 此处输入滚动内容 在基本语法中输入文字代码、代入图片代码、Flash动画代码和表格代码。 <marquee>这里是输入文字的地方,还可以放图片代码、Flash动画代码和gif动态小图代码。</marquee> 示例如下表:

文字

 图片

Flash动画

表格

LOVE

启野博客 

marquee标签属性

direction
表示滚动的方向(默认为left)
behavior
表示滚动的方式
loop
决定滚动文字的滚动次数
scrollamount       
决定文字滚动的速度
scrolldelay
决定文字滚动的延时
bgcolor            
文字滚动范围的背景颜色
width和height      
决定滚动文字在页面中的矩形范围大小
hspace和vspace     
决定滚动矩形区域距周围的空白区域
onmouseover=this.stop()  onmouseout=this.start()
表示当鼠标移上区域的时候滚动停止 表示当鼠标移开的时候又继续滚动
align  
水平对齐
valign 
垂直对齐方式
备注:marquee标签的属性都是可选的,根据需要而定制。

marquee标签属性详解

属性

属性的参数值

示例代码

示例

direction="left"

向左(默认值)

<marquee direction="left">我向左滚动</marquee>

direction="right"

向右

<marquee direction="right">我向右滚动</marquee>

direction="up"

向上

<marquee direction="up">我向上滚动</marquee>

direction="down"

向下

<marquee direction="down">我向下滚动</marquee>

behavior="alternate"

来回滚动

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

behavior="scroll"

单方向循环滚动

<marquee behavior="scroll">我单方向循环滚动</marquee>

<marquee behavior="scroll" direction="up" height="30">我改单方向向上循环滚动</marquee>

我改单方向向上循环滚动

behavior="slide"

只滚动一次

<marquee behavior="slide">我只滚动一次</marquee>

<marquee behavior="slide" direction="up">我改向上只滚动一次了</marquee>

我改向上只滚动一次了

loop="2"

滚动2次

<marquee loop="2">我滚动2次。</marquee>

loop="infinite"

无限循环滚动

<marquee loop="infinite">我无限循环滚动。</marquee>

loop="-1"

<marquee loop="-1">我无限循环滚动。</marquee>

scrollamount速度属性

延时属性

scrollamount="100"

速度很快

<marquee scrollamount="100">我速度很快</marquee>

scrollamount="50"

速度慢了些

<marquee scrollamount="50">我慢了些。</marquee>

scrolldelay="30"

小步前进

<marquee scrolldelay="30">我小步前进。</marquee>

scrolldelay="1000" scrollamount="100"

大步前进

<marquee scrolldelay="1000" scrollamount="100">我大步前进。</marquee>

bgcolor

背景颜色

bgcolor属性文字滚动范围的背景颜色,参数值是16进制(形式:#AABBCC或#AA5566等)或预定义的颜色名字(如red、yellow、blue等)。

<marquee behavior=="slide" direction="left" bgcolor="yellow">我的背景色是黄色的</marquee>

width

height

width和height属性的作用决定滚动文字在页面中的矩形范围大小。

width属性用以规定矩形的宽度,height属性规定矩形的高度。

这两个属性的参数值可以是数字或者百分数,数字表示矩形所占的(宽或高)像素点数,百分数表示矩形所占浏览器窗口的(宽或高)百分比。

<marquee width="300" height="30" bgcolor="red">我宽300像素,高30像素。</marquee>

hspace

vspace

hspace和vspace属性这两个属性决定滚动矩形区域距周围的空白区域。

<marquee width="300" height="30" vspace="10" hspace="10" bgcolor="red">我矩形边缘水平和垂直距周围各10像素。</marquee>

<marquee width="300" height="30" vspace="50" hspace="50" bgcolor="red">我矩形边缘水平和垂直距周围各50像素。</marquee>

onmouseover

=this.stop() onmouseout

=this.start()

表示当鼠标移上区域的时候滚动停止,当鼠标移开的时候又继续滚动。

<marquee onmouseover=this.stop() onmouseout=this.start()>表示当鼠标移上区域的时候滚动停止,当鼠标移开的时候又继续滚动。</marquee>

valign

align

对齐属性

这里是输入文字

valign 表示元素的垂直对齐方式,值可以是top,middle,bottom,默认为middle。这个属性在TABLE标签的表格处理文字。

<MARQUEE scrollAmount=3 behavior=alternate>

<TABLE

borderColor=#003333

align=center border=1>

<TBODY>

<TR><TD> 这个属性在TABLE标签的表格处理文字。

</TD>

</TR>

</TBODY>

</TABLE>

</MARQUEE>

align 表示元素的水平对齐方式,值可以是left,center,right,默认为left。这个属性决定滚动文字位于距形内边框的上下左右位置。

<marquee direction=up width="300" height="200" bgcolor=#ccffff><P align=center>这个属性决定滚动文字位于距形内边框的上下左右位置。</P></marquee>

本文转自    风雨萧条 博客,原文链接:    http://blog.51cto.com/1095221645/1844528    如需转载请自行联系原作者

继续阅读