html之marquee详解
来源:互联网 发布:淘宝运营计划方案 编辑:程序博客网 时间:2024/04/28 02:29
该标签是个容器标签
语法:
以下是一个最简单的例子:
代码如下:
onMouseOut="this.start()" :用来设置鼠标移出该区域时继续滚动
onMouseOver="this.stop()":用来设置鼠标移入该区域时停止滚动
代码如下:
这是一个完整的例子
</marquee>
该标签支持的属性多达11个:
align
设定<marquee>标签内容的对齐方式
absbottom:绝对底部对齐(与g、p等字母的最下端对齐)
absmiddle:绝对中央对齐
baseline:底线对齐
bottom:底部对齐(默认)
left:左对齐
middle:中间对齐
right:右对齐
texttop:顶线对齐
top:顶部对齐
代码如下:
<marquee align="absmiddle">align="absmiddle": 绝对中央对齐。 </marquee>
<marquee align="baseline">align="baseline": 底线对齐。 </marquee>
<marquee align="bottom">align="bottom": 底部对齐(默认)。 </marquee>
<marquee align="left">align="left": 左对齐。 </marquee>
<marquee align="middle">align="middle": 中间对齐。 </marquee>
<marquee align="right">align="right": 右对齐。 </marquee>
<marquee align="texttop">align="texttop": 顶线对齐。 </marquee>
<marquee align="top">align="top": 顶部对齐。 </marquee>
behavior
设定滚动的方式:
alternate: 表示在两端之间来回滚动。
scroll: 表示由一端滚动到另一端,会重复。
slide: 表示由一端滚动到另一端,不会重复。
<marquee behavior="scroll">scroll:表示由一端滚动到另一端,会重复。</marquee>
<marquee behavior="slide">slide: 表示由一端滚动到另一端,不会重复。</marquee>
bgcolor
设定活动字幕的背景颜色,背景颜色可用RGB、16进制值的格式或颜色名称来设定。
<marquee bgcolor="RGB(10%,50%,100%,)">设定活动字幕的背景颜色 bgcolor="rgb(10%,50%,100%,)"</marquee>
<marquee bgcolor="red">设定活动字幕的背景颜色 bgcolor="red"</marquee>
direction
设定活动字幕的滚动方向
<marquee direction="left">设定活动字幕的滚动方向direction="left":向左</marquee>
<marquee direction="right">设定活动字幕的滚动方向direction="right":向右</marquee>
<marquee direction="up">设定活动字幕的滚动方向direction="up":向上</marquee>
height
设定活动字幕的高度
<marquee height="500" direction="down" bgcolor="#CCCCCC">设定活动字幕的高度height="500"</marquee>
width
设定活动字幕的宽度
<marquee width="500" bgcolor="#CCCCCC">设定活动字幕的宽度width="500"</marquee>
设定活动字幕里所在的位置距离父容器水平边框的距离
This controls the horizontal(水平)space around the display box.
<tr>
<td><marquee hspace="100" bgcolor="#CCCCCC">hspace="100"</marquee></td>
</tr>
</table>
vspace
设定活动字幕里所在的位置距离父容器垂直边框的距离
This controls the vertical(垂直) space around the display box.
<marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>
设定滚动的次数,当loop=-1表示一直滚动下去,默认为-1
<p> </p>
<marquee loop="2" bgcolor="#CCCCCC">我只走两次哦</marquee>
scrollamount
设定活动字幕的滚动速度,单位pixels
<marquee scrollamount="20" >scrollamount="20" </marquee>
<marquee scrollamount="30" >scrollamount="30" </marquee>
scrolldelay
设定活动字幕滚动两次之间的延迟时间,单位millisecond(毫秒)
值大了会有一步一停顿的效果
<marquee scrolldelay="100" > scrolldelay="100"</marquee>
<marquee scrolldelay="1000">scrolldelay="1000" </marquee>
页面的自动滚动效果,可由javascript来实现,但是html标签 - <marquee></marquee>可以实现多种滚动效果,无需js控制。
使用marquee标记不仅可以移动文字,也可以移动图片,表格等.
语法:<marquee>...</marquee>; 说明:在标记之间添加要进行滚动的内容。
重要属性:
1.滚动方向direction(包括4个值:up、 down、 left和 right)
语法:<marquee direction="滚动方向">...</marquee>
2.滚动方式behavior(scroll:循环滚动,默认效果; slide:只滚动一次就停止; alternate:来回交替进行滚动)
语法:<marquee behavior="滚动方式">...</marquee>
3.滚动速度scrollamount(滚动速度是设置每次滚动时移动的长度,以像素为单位)
语法:<marquee scrollamount="5">...</marquee>
4.滚动延迟scrolldelay(设置滚动的时间间隔,单位是毫秒)
语法:<marquee scrolldelay="100">...</marquee>
5.滚动循环loop(默认值是-1,滚动会不断的循环下去)
语法:<marquee loop="2">...</marquee>
6.滚动范围width、height
7.滚动背景颜色bgcolor
8.空白空间hspace、vspace
代码示例:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><div><marquee direction="up" behavior="scroll" scrollamount="1" scrolldelay="0" loop="-1" width="1000" height="50" bgcolor="#0099FF" hspace="10" vspace="10">指整个Marquee对齐方式; (2)behavior:设置滚动的方式: scroll:表示由一端滚动到另一端,会重复,缺陷是不能无缝滚动。 slide:表示由一段滚动到另一端,不会重复...</marquee></div></body></html>
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之marquee详解
- html之<marquee>详解
- html之marquee详解
- html之marquee详解
- spring mvc post方法接收参数为null
- 1005 Number Sequence(广义斐波那契数列)
- poj 1176 Party Lamps 模拟
- 谷歌电子市场开发流程(8)-自定义控件
- C++中函数重载的实现原理
- html之marquee详解
- 51Nod-1500-苹果曼和树
- html5新增标签
- debug date filter in logstash
- vue 组件之间使用eventbus传值
- 51Nod-1510-最小化序列
- 可编辑div:contenteditable之ctrl+enter换行,enter发送
- 线性表(List)---链式存储结构(双向链表)
- VirtualBox 创建com对象失败 应用程序被中断