滚动字幕标签<marquee>

本文详细介绍了HTML中的&lt;marquee&gt;标签,该标签用于创建网页上的滚动文本、图片和表格等内容。文章覆盖了&lt;marquee&gt;的基本用法及其多个属性,如behavior、bgcolor、direction等,并提供了具体的使用示例。

<marquee>标签

 1.页面自动滚动效果,使用<marquee>标签可以移动文字,表格,图片等。

   移动文字:

<marquee><p>文字</p> | <img src='图片路径'/> |  <table>表格</table></marquee>

2.behavior属:设定滚动方式,

 

值有:alternate:来回滚动,scroll: 一端滚动到另一端。slide:  只滚动一次。

 

<marquee behavior="alternate">来回滚动</marquee>

 3.bgcolor属性:字幕背景颜色。

 

<marquee bgcolor="#223344">背景颜色</marquee>

 4.direction属性:滚动方向。

值:down:向下,top:向上,left:向左,right:向右。

<marquee behavior="left">字幕滚动方向自右向左滚动</marquee>

 5.height属性:字幕滚动区域的高,width属性:字幕滚动区域的宽。

<marquee height="100px" width="200px">滚动字幕的宽高分别为200px,100px</marquee>

 6.hspace属性:设置滚动字幕区域相对于父类的水平距离。

 

 

 

<div  style="height:500px,wigth:800px">
    <marquee hspace="50px">距离DIV的水平距离为50px</marquee>
</div>

 7.vspace属性:设置滚动字幕区域相对于父类的垂直距离。

<div  style="height:500px,wigth:800px">
    <marquee hspace="30px">距离DIV的垂直距离为30px</marquee>
</div>

 8.loop属性:设置字幕滚动次数。

 

值:-1:无线循环,可为数值,默认为-1.

9.scrollamount属性:设置字幕滚动速度。

值为数字,单位px.

 

<marquee scrollamount="10" >滚动速度为10px/s </marquee>

 10.scrolldelay属性:设置字幕滚动的延迟时间,

 

值为数值,单位毫秒,最小值为60毫秒。

 

<marquee scrolldelay="100 " >两次滚动前后间隔100毫秒 </marquee>

 11.可以嵌套使用<marquee>。

<marquee behavior="alternate"  direction="dowm">
    <marquee behavior="alternate">字幕左右上下滚动</marquee>
</marquee>

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值