天天看點

移動文字(marquee标簽)w3c非标準

marquee标簽:建立一個滾動的文本字幕,應用于文字、圖檔、表格。 基本文法:  <marquee>...</marquee> 屬性彙總例句: <marquee direction=up behavior=scroll loop=3 scrollamount=1 scrolldelay=10 bgcolor=#ccffff height=150 width=15% hspace=20 vspace=10 onmouseover=this.stop() onmouseout=this.start()><P align=center>此處輸入滾動内容</P></marquee> 此處輸入滾動内容 在基本文法中輸入文字代碼、代入圖檔代碼、Flash動畫代碼和表格代碼。 <marquee>這裡是輸入文字的地方,還可以放圖檔代碼、Flash動畫代碼和gif動态小圖代碼。</marquee> 示例如下表:

文字

 圖檔

Flash動畫

表格

LOVE

啟野部落格 

marquee标簽屬性

direction
表示滾動的方向(預設為left)
behavior
表示滾動的方式
loop
決定滾動文字的滾動次數
scrollamount       
決定文字滾動的速度
scrolldelay
決定文字滾動的延時
bgcolor            
文字滾動範圍的背景顔色
width和height      
決定滾動文字在頁面中的矩形範圍大小
hspace和vspace     
決定滾動矩形區域距周圍的空白區域
onmouseover=this.stop()  onmouseout=this.start()
表示當滑鼠移上區域的時候滾動停止 表示當滑鼠移開的時候又繼續滾動
align  
水準對齊
valign 
垂直對齊方式
備注:marquee标簽的屬性都是可選的,根據需要而定制。

marquee标簽屬性詳解

屬性

屬性的參數值

示例代碼

示例

direction="left"

向左(預設值)

<marquee direction="left">我向左滾動</marquee>

direction="right"

向右

<marquee direction="right">我向右滾動</marquee>

direction="up"

向上

<marquee direction="up">我向上滾動</marquee>

direction="down"

向下

<marquee direction="down">我向下滾動</marquee>

behavior="alternate"

來復原動

<marquee behavior="alternate">我來復原動</marquee>

behavior="scroll"

單方向循環滾動

<marquee behavior="scroll">我單方向循環滾動</marquee>

<marquee behavior="scroll" direction="up" height="30">我改單方向向上循環滾動</marquee>

我改單方向向上循環滾動

behavior="slide"

隻滾動一次

<marquee behavior="slide">我隻滾動一次</marquee>

<marquee behavior="slide" direction="up">我改向上隻滾動一次了</marquee>

我改向上隻滾動一次了

loop="2"

滾動2次

<marquee loop="2">我滾動2次。</marquee>

loop="infinite"

無限循環滾動

<marquee loop="infinite">我無限循環滾動。</marquee>

loop="-1"

<marquee loop="-1">我無限循環滾動。</marquee>

scrollamount速度屬性

延時屬性

scrollamount="100"

速度很快

<marquee scrollamount="100">我速度很快</marquee>

scrollamount="50"

速度慢了些

<marquee scrollamount="50">我慢了些。</marquee>

scrolldelay="30"

小步前進

<marquee scrolldelay="30">我小步前進。</marquee>

scrolldelay="1000" scrollamount="100"

大步前進

<marquee scrolldelay="1000" scrollamount="100">我大步前進。</marquee>

bgcolor

背景顔色

bgcolor屬性文字滾動範圍的背景顔色,參數值是16進制(形式:#AABBCC或#AA5566等)或預定義的顔色名字(如red、yellow、blue等)。

<marquee behavior=="slide" direction="left" bgcolor="yellow">我的背景色是黃色的</marquee>

width

height

width和height屬性的作用決定滾動文字在頁面中的矩形範圍大小。

width屬性用以規定矩形的寬度,height屬性規定矩形的高度。

這兩個屬性的參數值可以是數字或者百分數,數字表示矩形所占的(寬或高)像素點數,百分數表示矩形所占浏覽器視窗的(寬或高)百分比。

<marquee width="300" height="30" bgcolor="red">我寬300像素,高30像素。</marquee>

hspace

vspace

hspace和vspace屬性這兩個屬性決定滾動矩形區域距周圍的空白區域。

<marquee width="300" height="30" vspace="10" hspace="10" bgcolor="red">我矩形邊緣水準和垂直距周圍各10像素。</marquee>

<marquee width="300" height="30" vspace="50" hspace="50" bgcolor="red">我矩形邊緣水準和垂直距周圍各50像素。</marquee>

onmouseover

=this.stop() onmouseout

=this.start()

表示當滑鼠移上區域的時候滾動停止,當滑鼠移開的時候又繼續滾動。

<marquee onmouseover=this.stop() onmouseout=this.start()>表示當滑鼠移上區域的時候滾動停止,當滑鼠移開的時候又繼續滾動。</marquee>

valign

align

對齊屬性

這裡是輸入文字

valign 表示元素的垂直對齊方式,值可以是top,middle,bottom,預設為middle。這個屬性在TABLE标簽的表格處理文字。

<MARQUEE scrollAmount=3 behavior=alternate>

<TABLE

borderColor=#003333

align=center border=1>

<TBODY>

<TR><TD> 這個屬性在TABLE标簽的表格處理文字。

</TD>

</TR>

</TBODY>

</TABLE>

</MARQUEE>

align 表示元素的水準對齊方式,值可以是left,center,right,預設為left。這個屬性決定滾動文字位于距形内邊框的上下左右位置。

<marquee direction=up width="300" height="200" bgcolor=#ccffff><P align=center>這個屬性決定滾動文字位于距形内邊框的上下左右位置。</P></marquee>

本文轉自    風雨蕭條 部落格,原文連結:    http://blog.51cto.com/1095221645/1844528    如需轉載請自行聯系原作者

繼續閱讀