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

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

marquee标签是一个容器标签,专为显示滚动文本设计,最初在HTML3.2中不被认可,仅在Microsoft Internet Explorer(IE)内核浏览器中得到支持。由于其特殊性,当使用非IE内核浏览器(如Netscape)时,您可能无法看到marquee标签的某些特效。以下将介绍marquee标签的语法、常用事件、以及支持的属性。

marquee标签的基本使用示例如下:

Hello, World

常用事件

marquee标签支持以下两个事件:

  • onMouseOut="this.start()":鼠标移出标签区域时继续滚动。
  • onMouseOver="this.stop()":鼠标移入标签区域时停止滚动。

例如,以下代码会在鼠标移入时停止滚动,移出时恢复滚动:

滚动内容

支持的属性

marquee标签支持以下11个属性:

  • align:设定内容的对齐方式,支持值包括 absbottomabsmiddlebaselinebottomleftmiddlerighttexttoptop
  • behavior:设定滚动方式,支持值包括 alternate(在两端之间来回滚动)、scroll(从一端滚动到另一端,循环重复)、slide(从一端滚动到另一端,不循环)。
  • bgcolor:设定活动字幕的背景颜色,可使用 #RRGGBBRGB(%,%,%) 或颜色名称。
  • direction:设定滚动方向,支持值包括 downleftrightup
  • height:设定活动字幕的高度。
  • hspace:设定活动字幕距离父容器水平边框的距离。
  • vspace:设定活动字幕距离父容器垂直边框的距离。
  • loop:设定滚动次数,默认为 -1 表示无限循环。
  • scrollamount:设定滚动速度(单位:像素)。
  • scrolldelay:设定滚动之间的延迟时间(单位:毫秒)。
  • 示例

    以下是一个完整的marquee标签使用示例:

    这是一个完整的示例

    进一步配置

    marquee标签还可以嵌套其他标签,如 <p><font>,以实现更复杂的样式控制。

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

    你可能感兴趣的文章
    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目录结构
    查看>>
    no1
    查看>>