怎样在网页中添加滚动的文字
来源:网络收集 点击: 时间:2024-04-06新建记事本文件,并重命名为.html文件,用记事本的方式打开,添加必要的标签!


滚动的文字主要用到的是marquee/marquee,小试一下,不添加任何属性修饰,默认为重复滚动的!

先来看它的所支持的属性,behavior为设定滚充的方式,alternate为来回滚动,scroll为重复滚动,side为不重复滚动!marquee behavior=alternate来回滚动/marquee

bgcolor为更改背景颜色,可以通过以下三种方式设背景颜色:bgcolor=#7FFF00,bgcolor=red,bgcolor=rgb(10%,50%,100%),


direction为更改文字的活动的方向,可以设定为四个不同的方向:direction=down,direction=up,direction=left,direction=right,同时,width控制文字活动的宽度,height控制文字活动的高度!


loop为控制滚动的次数,loop=-1表示一直滚动下去,默认为-1,loop=1表示只滚动一次, scrollamoun为设定滚动的速度scrollamount=10,单位为毫秒,值越大越快,速度越快!


html
head
title滚动的文字/title
/head
body
marquee百度经验/marquee
marquee behavior=alternate bgcolor=#7FFF00来回滚动/marquee
marquee behavior=scroll bgcolor=red重复滚动/marquee
marquee behavior=slide bgcolor=rgb(10%,50%,100%)不重复滚动/marquee
marquee direction=down height=500设定活动字幕的滚动方向/marquee
marquee direction=up hieght=800 width=400设定活动字幕的高度与宽度/marquee
marquee loop=-1 scrollamount=50滚动的次数与速度/marquee
/body
/html
网页版权声明:
1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。
2、本站仅提供信息发布平台,不承担相关法律责任。
3、若侵犯您的版权或隐私,请联系本站管理员删除。
4、文章链接:http://www.1haoku.cn/art_441128.html