特殊技巧 · 2022年7月7日 0

HTML文字移动特效代码

HTML文字移动特效代码

从左向右移文字移动

效果:

需要移动的文字:sk885.com

代码:

<marquee direction=right>需要移动的文字:sk885.com</marquee>

从右向左移动

效果:

需要移动的文字:sk885.com

代码:

<marquee direction=left>需要移动的文字:sk885.com</marquee>

从上向下移动文字移动

效果:

需要移动的文字:sk885.com

代码:

<marquee direction=down><div align="center">需要移动的文字:sk885.com</div></marquee>

从下向上移动

效果:

需要移动的文字:sk885.com

代码:

 <marquee direction=up><div align="center">需要移动的文字:sk885.com</div></marquee>

移一步,停一停文字移动代码

效果:

需要移动的文字:sk885.com

代码:

<marquee scrolldelay=500 scrollamount=100>需要移动的文字:sk885.com</marquee>

只移动三次就停了

效果:

需要移动的文字:sk885.com

代码:

<marquee loop=3 behavior=slide>需要移动的文字:sk885.com</marquee>

左右来回移动

效果:

需要移动的文字:sk885.com

代码:

 <marquee behavior=alternate>需要移动的文字:sk885.com</marquee>

水平相反移动文字移动代码

效果:

需要移动的文字:sk885.com需要移动的文字:sk885.com

代码:

<p align=center> <marquee width="216px">需要移动的文字:sk885.com</marquee><marquee width="216px" direction=right>需要移动的文字:sk885.com</marquee></p>

一圈一圈绕着移动

效果:

需要移动的文字:sk885.com

代码:

 <marquee behavior=scroll>需要移动的文字:sk885.com</marquee>

垂直往复移动文字移动代码

效果:

需要移动的文字:sk885.com

代码:

 <marquee direction=up behavior=alternate><div align="center">需要移动的文字:sk885.com</font></div></marquee>

左右两边向中间移动

效果:

需要移动的文字:sk885.com需要移动的文字:sk885.com

代码:

 <p align=center><marquee style="width:216px;" direction=right>需要移动的文字:sk885.com</marquee><marquee style="width:216px;" direction=left>需要移动的文字:sk885.com</marquee></p>

从上下向中间移动

效果:

需要移动的文字:sk885.com
需要移动的文字:sk885.com

代码:

<p></p><center><marquee width=288 direction=down scrollAmount=2 height=50><center>需要移动的文字:sk885.com</center></marquee><center><marquee width=288 direction=up scrollAmount=2 height=50><center>需要移动的文字:sk885.com</center></marquee></center></center><p></p>

左右两边向中间来回移动

效果:

左右向中间来回移动动移回来间中向右左

代码:

 <MARQUEE scrollAmount=3 behavior=alternate width="40%">左右向中间来回移动</MARQUEE><MARQUEE scrollAmount=3 direction=right behavior=alternate width="40%">动移回来间中向右左</MARQUEE>

上下向中间来回移动文字移动代码

效果:

上下向中间来回移动
上下向中间来回移动

代码:

 <MARQUEE scrollAmount=1 direction=down behavior=alternate height=50><DIV align=center>上下向中间来回移动</DIV></MARQUEE><MARQUEE scrollAmount=1 direction=up behavior=alternate height=50><DIV align=center>上下向中间来回移动</DIV></MARQUEE>

从中间向上下移动

效果:

需要移动的文字:sk885.com
需要移动的文字:sk885.com

代码:

<p></p><center><marquee width=288 direction=up scrollAmount=2 height=50><center>需要移动的文字:sk885.com</center></marquee><center><marquee width=288 direction=down scrollAmount=2 height=50><center>需要移动的文字:sk885.com</center></marquee></center></center><p> </p></marquee>

忽隐忽现移动

效果:

需要移动的文字:sk885.com

代码:

<marquee behavior="alternate"><marquee width="150" direction=right>需要移动的文字:sk885.com</marquee>
各主要参数的含义
align:是设定活动对象(图片或文字)的位置。

direction:用于设定活动对象的移动方向。

behavior="scroll"表示由一端移动到另一端。

behavior="slide"表示由一端移动到另一端,且不再重复。

behavior="alternate"表示在两端之间来回移动。

height:用于设定移动对象的高度。

width:则设定移动对象的宽度。

hspace:用于设定移动对象的左右边框宽度。

vspace:上下边框的宽度。

scrollamount:用于设定活动对象的移动距离,数值越大移动越快。

scrolldelay:用于设定移动两次之间的延迟时间,数值越大越有跳跃感。

loop:用于设定移动的次数,不设置该值则为无限循环

style="font-size: "用于设定文字大小。

wline-htight: 用于设定文字行间距。

font-family: 用于设定字体。

<marquee>标记的默认情况是向左移动无限次,字幕高度是文本高度,移动范围:水平移动的宽度是当前位 置的宽度,垂直移动的高度是当前位置的高度。


 黔ICP备2022004321号-2

    贵公网安备 52022202000130号

小胡哥 .All Rights Reserved

声明: 本站为非赢利性网站,部分素材来源于互联网,如有侵权请与本站联系删除。