实现像本博客顶部文字移动的效果,其实很简单,只需要修改所用风格中INCLUDE文件夹下的header.html文件就能实现。这里主要应用了实现文字移动的《Marquee》语法。
基本语法:
<marquee>需要移动的文字</marquee>
移动属性的设置,这种移动不仅仅局限于文字,也可以应用于图片,表格等等,具体的参数意义以及设施方式如下:
1、方向<direction=*> *=left, right 默认情况下是从右向左
代码:<marquee direction=left>从右向左移动</marquee>
演示:
代码:<marquee direction=right>从左向右移动</marquee>
演示:
2、方式 <bihavior=*> *=scroll, slide, alternate
代码:<marquee behavior=scroll>一圈一圈的绕着移动</marquee>
演示:
代码:<marquee behavior=slide>只移动一次就停</marquee>
演示:
代码:<marquee behavior=alternate>来回移动,不停</marquee>
演示:
3、循环 <loop=*> * =次数,若未指定则循环不止(infinite)
代码:<marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee>
演示:
4、速度加快 <scrollamount=*>
代码:<marquee scrollamount=20>移动速度加快</marquee>
演示:
5、速度减慢 <scrolldelay=*>
代码:<marquee scrolldelay=500 scrollamount=100>移动速度减慢</marquee>
演示:
6、对齐方式 <align=*> *=top, middle, bottom
代码:<font size=6>
<marquee align=top width=400>啦啦啦,我会移动耶!</marquee>
</font>
演示:
7、底色 <bgcolor=*> *=rrggbb 16进制数码,或者是下列预定义色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
例:<marquee bgcolor=red>背景色是红色的</marquee>
8、面积 <height=* width=*>
例:<marquee height=80 bgcolor=red>面积变大了</marquee>
发表评论