DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> HTML基礎知識 >> HTML和Xhtml
HTML Marquee 跑馬燈滾動效果屬性詳解
編輯:HTML和Xhtml     

marquee 標籤可用來製作文字或圖片的滾動動畫,透過下列屬性即可控制滾動的方向、方式與速度。

direction:設定滾動方向

<marquee direction="down">向下滾動</marquee>
<marquee direction="left">向左滾動</marquee>
<marquee direction="right">向右滾動</marquee>
<marquee direction="up">向上滾動</marquee>

behavior:設定滾動方式

  • alternate:在兩端之間來回滾動。
  • scroll:由一端滾動到另一端,會重複循環。
  • slide:由一端滾動到另一端,只滾動一次不重複。
<marquee behavior="alternate">來回滾動</marquee>
<marquee behavior="scroll">循環滾動</marquee>
<marquee behavior="slide">滑動一次</marquee>

scrollamount:設定滾動速度

單位為 pixels,數值越大速度越快。

<marquee scrollamount="10">scrollamount="10"</marquee>
<marquee scrollamount="20">scrollamount="20"</marquee>
<marquee scrollamount="30">scrollamount="30"</marquee>

scrolldelay:設定滾動延遲

單位為毫秒(millisecond),設定兩次滾動之間的間隔。數值較大時會出現一步一停頓的效果。

<marquee scrolldelay="10">scrolldelay="10"</marquee>
<marquee scrolldelay="100">scrolldelay="100"</marquee>
<marquee scrolldelay="1000">scrolldelay="1000"</marquee>

提醒:marquee 並非W3C標準標籤,雖在多數瀏覽器仍可顯示,但正式專案建議改用CSS動畫或JavaScript來實作滾動效果。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved