博客
关于我
html中的marquee属性使用
阅读量:407 次
发布时间:2019-03-05

本文共 2074 字,大约阅读时间需要 6 分钟。

该标签不是HTML3.2的一部分,并且只支持MSIE3以后内核,所以如果你使用非IE内核浏览器(如:Netscape)可能无法看到下面一些很有意思的效果,该标签是个容器标签。

语法:

以下是一个最简单的例子,代码如下:

Hello, World

下面这两个事件经常用到:

onMouseOut=“this.start()” :用来设置鼠标移出该区域时继续滚动

onMouseOver=“this.stop()”:用来设置鼠标移入该区域时停止滚动
代码如下:

<marquee onMouseOut="this.start()" onMouseOver=“this.stop()”>onMouseOut=“this.start()” :用来设置鼠标移出该区域时继续滚动 onMouseOver=“this.stop()”:用来设置鼠标移入该区域时停止滚动

这是一个完整的例子:

代码如下:

这是一个完整的例子

该标签支持的属性多达11个:

align

设定标签内容的对齐方式

absbottom:绝对底部对齐(与g、p等字母的最下端对齐)absmiddle:绝对中央对齐baseline:底线对齐bottom:底部对齐(默认)left:左对齐middle:中间对齐right:右对齐texttop:顶线对齐top:顶部对齐

代码如下:

align="absbottom":绝对底部对齐(与g、p等字母的最下端对齐)。
align="absmiddle": 绝对中央对齐。
align="baseline": 底线对齐。
align="bottom": 底部对齐(默认)。
align="left": 左对齐。
align="middle": 中间对齐。
align="right": 右对齐。
align="texttop": 顶线对齐。
align="top": 顶部对齐。

behavior

设定滚动的方式:

alternate: 表示在两端之间来回滚动。scroll: 表示由一端滚动到另一端,会重复。slide:  表示由一端滚动到另一端,不会重复。

代码如下:

alternate:表示在两端之间来回滚动。
scroll:表示由一端滚动到另一端,会重复。
slide: 表示由一端滚动到另一端,不会重复。

bgcolor

设定活动字幕的背景颜色,背景颜色可用RGB、16进制值的格式或颜色名称来设定。代码如下:

设定活动字幕的背景颜色 bgcolor="#006699"
设定活动字幕的背景颜色 bgcolor="rgb(10%,50%,100%,)"
设定活动字幕的背景颜色 bgcolor="red"

direction

设定活动字幕的滚动方向,代码如下:

设定活动字幕的滚动方向direction="down":向下
设定活动字幕的滚动方向direction="left":向左
设定活动字幕的滚动方向direction="right":向右
设定活动字幕的滚动方向direction="up":向上

height

设定活动字幕的高度,代码如下:

设定活动字幕的高度height=“500”

width

设定活动字幕的宽度,代码如下:

设定活动字幕的宽度width=“500”

hspace

设定活动字幕里所在的位置距离父容器水平边框的距离,代码如下:

hspace="100"

vspace

设定活动字幕里所在的位置距离父容器垂直边框的距离,代码如下:

hspace=“100”

loop

设定滚动的次数,当loop=-1表示一直滚动下去,默认为-1,代码如下:

我会不停地走。

我只走两次哦

scrollamount

设定活动字幕的滚动速度,单位pixels,代码如下:

scrollamount="10"
scrollamount="20"
scrollamount="30"

scrolldelay

设定活动字幕滚动两次之间的延迟时间,单位millisecond(毫秒),值大了会有一步一停顿的效果。代码如下:

scrolldelay="10"
scrolldelay="100"
scrolldelay="1000"

转载地址:http://xptzz.baihongyu.com/

你可能感兴趣的文章
NO 157 去掉禅道访问地址中的zentao
查看>>
no available service ‘default‘ found, please make sure registry config corre seata
查看>>
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
查看>>
no connection could be made because the target machine actively refused it.问题解决
查看>>
No Datastore Session bound to thread, and configuration does not allow creation of non-transactional
查看>>
No fallbackFactory instance of type class com.ruoyi---SpringCloud Alibaba_若依微服务框架改造---工作笔记005
查看>>
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalanc
查看>>
No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
查看>>
No mapping found for HTTP request with URI [/logout.do] in DispatcherServlet with name 'springmvc'
查看>>
No module named 'crispy_forms'等使用pycharm开发
查看>>
No module named cv2
查看>>
No module named tensorboard.main在安装tensorboardX的时候遇到的问题
查看>>
No module named ‘MySQLdb‘错误解决No module named ‘MySQLdb‘错误解决
查看>>
No new migrations found. Your system is up-to-date.
查看>>
No qualifying bean of type XXX found for dependency XXX.
查看>>
No qualifying bean of type ‘com.netflix.discovery.AbstractDiscoveryClientOptionalArgs<?>‘ available
查看>>
No resource identifier found for attribute 'srcCompat' in package的解决办法
查看>>
no session found for current thread
查看>>
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
查看>>
NO.23 ZenTaoPHP目录结构
查看>>