語法:
<marquee></marquee>
以下是一個最簡單的例子:
代碼如下:
<marquee><font size=+3 color=red>Hello, World</font></marquee>
下面這兩個事件經常用到:
on
on
代碼如下:
<marquee on
這是一個完整的例子:
代碼如下:
<marquee id="affiche" align="left" beha
這是一個完整的例子
</marquee>
該標簽支持的屬性多達11個:
align
設定<marquee>標簽內容的對齊方式
absbottom:絕對底部對齊(與g、p等字母的最下端對齊)
absmiddle:絕對中央對齊
baseline:底線對齊
bottom:底部對齊(默認)
left:左對齊
middle:中間對齊
right:右對齊
texttop:頂線對齊
top:頂部對齊
代碼如下:
<marquee align="absbottom">align="absbottom":絕對底部對齊(與g、p等字母的最下端對齊)。 </marquee>
<marquee align="absmiddle">align="absmiddle": 絕對中央對齊。 </marquee>
<marquee align="baseline">align="baseline": 底線對齊。 </marquee>
<marquee align="bottom">align="bottom": 底部對齊(默認)。 </marquee>
<marquee align="left">align="left": 左對齊。 </marquee>
<marquee align="middle">align="middle": 中間對齊。 </marquee>
<marquee align="right">align="right": 右對齊。 </marquee>
<marquee align="texttop">align="texttop": 頂線對齊。 </marquee>
<marquee align="top">align="top": 頂部對齊。 </marquee>
beha
設定滾動的方式:
alternate: 表示在兩端之間來回滾動。
scroll: 表示由一端滾動到另一端,會重復。
slide: 表示由一端滾動到另一端,不會重復。
代碼如下:
<marquee behavior="alternate">alternate:表示在兩端之間來回滾動。 </marquee>
<marquee beha
<marquee beha
bgcolor
設定活動字幕的背景顏色,背景顏色可用RGB、16進制值的格式或顏色名稱來設定。
代碼如下:
<marquee bgcolor="#006699">設定活動字幕的背景顏色 bgcolor="#006699"</marquee>
<marquee bgcolor="RGB(10%,50%,100%,)">設定活動字幕的背景顏色 bgcolor="rgb(10%,50%,100%,)"</marquee>
<marquee bgcolor="red">設定活動字幕的背景顏色 bgcolor="red"</marquee>
direction
設定活動字幕的滾動方向
代碼如下:
<marquee direction="down">設定活動字幕的滾動方向direction="down":向下</marquee>
<marquee direction="left">設定活動字幕的滾動方向direction="left":向左</marquee>
<marquee direction="right">設定活動字幕的滾動方向direction="right":向右</marquee>
<marquee direction="up">設定活動字幕的滾動方向direction="up":向上</marquee>
height
設定活動字幕的高度
代碼如下:
<marquee height="500" direction="down" bgcolor="#CCCCCC">設定活動字幕的高度height="500"</marquee>
width
設定活動字幕的寬度
代碼如下:
<marquee width="500" bgcolor="#CCCCCC">設定活動字幕的寬度width="500"</marquee>
hspace
設定活動字幕里所在的位置距離父容器水平邊框的距離
This controls the horizontal(水平)space around the display box.
代碼如下:
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><marquee hspace="100" bgcolor="#CCCCCC">hspace="100"</marquee></td>
</tr>
</table>
vspace
設定活動字幕里所在的位置距離父容器垂直邊框的距離
This controls the vertical(垂直) space around the display box.
代碼如下:
<marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>
loop
設定滾動的次數,當loop=-1表示一直滾動下去,默認為-1
代碼如下:
<marquee loop="-1" bgcolor="#CCCCCC">我會不停地走。</marquee>
<p> </p>
<marquee loop="2" bgcolor="#CCCCCC">我只走兩次哦</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> ... </marquee>
移動屬性的設置 ,這種移動不僅僅局限於文字,也可以應用於圖片,表格等等
鼠標屬性
on
on
方向
<direction=#> #=left, right ,up ,down <marquee direction=left>從右向左移!</marquee>
方式
<bihavior=#> #=scroll, slide, alternate <marquee beha
<marquee beha
<marquee beha
循環
<loop=#> #=次數;若未指定則循環不止(infinite) <marquee loop=3 width=50% beha
<marquee loop=3 width=50% beha
<marquee loop=3 width=50% beha
速度
<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
延時
<scrolldelay=#> <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
外觀(Layout)設置
對齊方式(Align)
<align=#> #=top, middle, bottom <font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
底色
<bgcolor=#> #=rrggbb 16 進制數碼,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee bgcolor=aaaaee>顏色!</marquee>
面積
<height=# width=#> <marquee height=40 width=50% bgcolor=aaeeaa>面積!</marquee>
空白
(Margins)<hspace=# vspace=#>
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>面積!</marquee>
</P>
<marquee id="iescroller" direction=left height=10 on
marquee的滾動屬性參數 |
從<marquee>開始到</marquee>結束,其中有很多參數,其實,朋友們還是應用得很多了,讓圖片滾動起來,也是經常經常應用的,下面對這個網頁參數的屬性做一些簡單的描述; 滾動參數: 1:方向:DIRECTION left---左(默認) right---右 up------上 down----下 2:方式:BEHA SCROLL -------環繞滾動(默認) SLIDE---------滾動一次 ALTERNATE-----來回滾動 3:次數:LOOP 當LOOP=-1或LOOP=INFINITE時,則表明文字滾動是無限循環(默認) 4:速度:SCROLLDELAY 任意自然整數 5:對齊:ALIGN TOP---------對齊上方 MIDDLE------對齊中部 BOTTOM------對齊下方 6:鼠標的划過與離開 on 划過停止滾動。離開,繼續滾動 有了以上參數。我們就很容易制作出一個logo圖片的任意滾動方式,例如: <marquee width=120 height=200 DIRECTION=up BEHA 很容易對照出。這是一個滾動速度為120MM,從下到上碰壁即返回並對齊中間,鼠標划過圖標即停止,點擊圖標進入〈千嬌論壇〉的一個來回滾動的代碼。 在背景圖片上做滾動字幕 <TABLE width="500" border=0> <TBODY> <TR> <TD background=背景圖片地址 height=250> <P><MARQUEE scrollAmount=2 scrollDelay=50 direction=up width=200 height=200 beha 參數設置: a)scrollAmount表示速度,值越大速度越快。如果沒有它,默認為6,建議設為1~3比較好 b)scrollDelay也是用來控制速度的,表示走走停停,默認為90,值越大,速度越慢。通常scrollDelay是不需要設置的。 c)direction很明顯是表示滾動的方向,默認為從右向左:←,因此如果是向左滾動的話不需要次參數。其他可選的值還有right,down,up。滾動方向分別為:right表示→,up表示↑,down表示↓。 d)width和height用來表示滾動區域的大小,width是寬度,height是高度。特別是在做垂直滾動的時候,一定要設height的值。 e)beha f)每行字的前后<FONT color=#990066 size=4 face=隸書>和</FONT>用定義每行字的顏色,大小和字體,如果哪項不需要的話,把代碼去掉就行。 |