zoukankan      html  css  js  c++  java
  • 舞动你的文字,巧用CSS中marquee属性

    语法:<marquee> …</marquee>

      使用移动属性marquee,不仅仅可以舞动你的文字,还可以应用于图片,表格等等。

      <marquee direction=left>欢迎光临科讯青年学习频道!</marquee>

      direction=left,表示方向。上面文字效果是“欢迎光临科讯青年学习频道!”从右向左移动!另外,方向还有right,up,down。

      除了方向,我们还可以添加其他限制的元素:

      移动的方式:

      循环移动:loop=n(n,表示次数)   绕圈移动:behavior=scroll   只走一次:behavior=slide   来回移动:behavior=alternate

      外观:

      字号:<font size=n>(n,变量)   对齐方式:align=top/middle/bottom   底色:bgcolor=Blue(预定义色彩,如:Black,Olive,Teal,Red,Blue,Maroon, Navy,Gray,Lime,Fuchsia,White,Green,Purple,Silver,Yellow,Aqua或16进制数码)

      其它:

      速度:scrollamount=n(n,变量)   延时:scrolldelay==n(n,变量)

    <marquee direction="向什么方向移动" height="移动区域高度" width="移动区域宽度" scrollamount="移动速度" onmouseover=this.stop() onmouseout=this.start()>" 

    onmouseover 设置鼠标放在移动区域的时候暂停移动

    onmouseout 鼠标离开的时候继续滚动

  • 相关阅读:
    javaScript系列 [35]HTML页面渲染的基本过程
    javaScript系列 [29] RegExp
    javaScript系列 [40]defineProperty
    javaScript系列 [32] type
    javaScript系列 [34]FormData
    javaScript系列 [39]deepClone
    javaScript系列 [33] new
    javaScript系列 [36]Call by sharing
    javaScript系列 [38]浏览器、HTML和内核(引擎)
    javaScript系列 [28] Event
  • 原文地址:https://www.cnblogs.com/hnyei/p/2395325.html
Copyright © 2011-2022 走看看