快速导航香茗社区总站 超级转贴工具制作相册视频 08新年祝福
发新话题
打印

文字和图片的运动

文字和图片的运动

学会了做基本的网页,我们来添加一些简单的效果,这里先讲一下文字和图片的运动。  
让文字和图片随着音乐的节奏动起来,啦啦啦......演出开始了!:)

移动字幕使用<marquee>标记,双标签。请勿必使用双标签,不然后面的伙伴全都跟你走,西西:)
其基本格式如下:
<marquee 属性=属性值> 滚动内容 </marquee>
它的主要属性及其属性值如下:
align,对齐方式,其属性值为center,left,right,top, middle, bottom,分别表示居中,左对齐,右对齐,对齐上沿、中间、下沿;
direction,移动方向,其属性值为left,right,up,down;
bgcolor,移动字符的背景色,属性值为颜色代码,可以是rrggbb 16 进制数码,r=red,g=green,b=blue,也就是色彩中的三原色,也可是预定义色彩;

loop,移动字符的循环次数,属性值为数字,若未指定则循环不止(infinite); behavior,移动方式,属性值为scroll:文字单向移动,side:移动到边界停止,alternate:到边界后反向移动;
width及height,文字高度和宽度,以象素为单位,属性值为数字;
hspace字符左右留白长度,属性值为数字;
vspace字符上下留白长度,属性值为数字;
scrollamount字符的移动速度,属性值为数字,数值越大速度越大,反之亦然;
scrolldelay字符移动每步的延时,属性值为数字,数值越大速度越大,反之亦然。


[ 本帖最后由 丫丫笑蜗牛 于 2007-6-1 16:32 编辑 ]

TOP

举例: 啦啦啦,我会移动耶! 啦啦啦,我会移动耶! 啦啦啦,我从右向左移! 啦啦啦,我一圈一圈绕着走! 啦啦啦,我来回走耶! 啦啦啦,我只走 3 趟哟! 啦啦啦,我走一步,停一停!
啦啦啦,我向上走,走一步停一停!
啦啦啦,我向下走,走一步停一停! 具体代码看跟帖

TOP

举例:


<marquee height=40 width=50% bgcolor=aaeeaa>啦啦啦,我会移动耶!</marquee>


<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>啦啦啦,我会移动耶!</marquee>


<marquee direction=left>啦啦啦,我从右向左移!</marquee>


<marquee behavior=scroll>啦啦啦,我一圈一圈绕着走!</marquee>


<marquee behavior=alternate>啦啦啦,我来回走耶!</marquee>


<marquee loop=3 width=50% behavior=scroll>啦啦啦,我只走 3 趟哟!</marquee>


<marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>


<center><marquee direction=up scrollamount=1 scrolldelay=10>啦啦啦,我向上走,走一步停一停!</marquee>


<center><marquee direction=down scrollamount=1 scrolldelay=10>啦啦啦,我向下走,走一步停一停!</marquee>


<marquee direction=up behavior=alternate width=50 height=200 scrolldelay ="80" scrollamount="4"><font size="30" color=red>一</font></marquee><marquee direction=up behavior=alternate width=50 height=200 scrolldelay="60" scrollamount="3"><font size="30" color="teal">起</font></marquee><marquee direction=up behavior=alternate width=50 height=200 scrolldelay="70" scrollamount="2"><font size="30" color="#4B638D">跳</font></marquee><marquee direction=up behavior=alternate width=50 height=200 scrolldelay="80" scrollamount="4"><font size="30" color="maroon">起</font></marquee><marquee direction=up behavior=alternate width=50 height=200 scrolldelay="90" scrollamount="5"><font size="30" color="#E16B33">来</font></marquee><marquee direction=up behavior=alternate width=50 height=200 scrolldelay="50" scrollamount="6"><font size="30" color=blue>!</font></marquee>

TOP

真聪明啊小丫丫!
风敲竹韵梅听雪,雨打兰香菊看霜

TOP

一起来学啊~破萝卜!

TOP

啦啦啦,你晃得我头晕啦!
风敲竹韵梅听雪,雨打兰香菊看霜

TOP

谁让你不跟着晃!;/lala

TOP

发新话题