html滚动文字代码是什么?

html-css07

html滚动文字代码是什么?,第1张

<marquee direction=up behavior=scroll loop=3 scrollamount=1 scrolldelay=10 align=top bgcolor=#ffffff height=300 width=30% hspace=20 vspace=10 onmouseover=this.stop() onmouseout=this.start()>此处输入滚动内容 </marquee>

◎ direction表示滚动的方向,值可以是left,right,up,down,默认为left

◎ behavior表示滚动的方式,值可以是scroll(连续滚动)slide(滑动一次)alternate(往返滚动)

◎ loop表示循环的次数,值是正整数,默认为无限循环

◎ scrollamount表示运动速度,值是正整数,默认为6

◎ scrolldelay表示停顿时间,值是正整数,默认为0,单位似乎是毫秒

◎ align表示元素的垂直对齐方式,值可以是top,middle,bottom,默认为middle

◎ bgcolor表示运动区域的背景色,值是16进制的RGB颜色,默认为白色

◎ height、width表示运动区域的高度和宽度,值是正整数(单位是像素)或百分数,默认width=100% height为标签内元素的高度

◎ hspace、vspace表示元素到区域边界的水平距离和垂直距离,值是正整数,单位是像素。

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

<marquee style="WIDTH: 388pxHEIGHT: 200px" scrollamount="2" direction="up" >

<div align="left" >

</div >

<center ><font face="黑体" color="#008000" size="4" ></font ></center >

<div align="left" >

</div >

<center >

<p ><font color="#ff6600" size="4" >滚动文字</font ></p >

<p ><font color="#ff4500" size="4" >滚动文字</font ></p >

<p ><font color="#ff3300" size="4" >滚动文字</font >

</p >

</marquee >

marquee 参数:

BGColor:滚动文本框的背景颜色。

Direction:滚动方向设置,可选择Left、Right、up和down。

scrolldelay:每轮滚动之间的延迟时间,越大越慢。

scrollamount:一次滚动总的时间量,数字越小滚动越慢。

Behaviour:滚动的方式设置,三种取值:Scroll(循环滚动) lide(单次滚动)、Alternate(来回滚动)。

Align:文字的对齐方式设置。可选择Middle(居中)、Bottom(居下)还是Top(居上)。

Width:滚动文本框的宽度,输入一个数值后从后面的单选框选择in Pixels(按像素)或是in Percent(按百分比)。

Height:滚动文本框的高度,输入一个数值后从后面的单选框选择in Pixels(按像素)或是in Percent(按百分比)。

loop:滚动次数。默认为infinite

hspace、vspace:前后、上下的空行。

在要实现滚动的地方,加入此代码:

<marquee

direction=up>要输入的文字</marquee>

up是向上,

down是向下,left向左,right向右.

这两个属性决定文字滚动的速度(scrollamount)和延时(scrolldelay),参数值都是正整数。如下所示:

<marquee

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

<marquee

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

<marquee

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

<marquee

scrolldelay="1000"

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

按照自己的需要写代码吧,希望能够帮助你!