国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

詳解html中的marquee屬性

2024-08-26 00:13:43
字體:
供稿:網(wǎng)友

該標(biāo)簽不是HTML3.2的一部分,并且只支持MSIE3以后內(nèi)核,所以如果你使用非IE內(nèi)核瀏覽器(如:Netscape)可能無法看到下面一些很有意思的效果

該標(biāo)簽是個(gè)容器標(biāo)簽

語法:

<marquee></marquee>

以下是一個(gè)最簡(jiǎn)單的例子:

代碼如下:

<marquee><font size=+3 color=red>Hello, World</font></marquee>

下面這兩個(gè)事件經(jīng)常用到:

onMouseOut="this.start()" :用來設(shè)置鼠標(biāo)移出該區(qū)域時(shí)繼續(xù)滾動(dòng)

onMouseOver="this.stop()":用來設(shè)置鼠標(biāo)移入該區(qū)域時(shí)停止?jié)L動(dòng)

代碼如下:

<marquee onMouseOut="this.start()" onMouseOver="this.stop()">onMouseOut="this.start()" :用來設(shè)置鼠標(biāo)移出該區(qū)域時(shí)繼續(xù)滾動(dòng) onMouseOver="this.stop()":用來設(shè)置鼠標(biāo)移入該區(qū)域時(shí)停止?jié)L動(dòng)</marquee>

這是一個(gè)完整的例子:

代碼如下:

<marquee id="affiche" align="left" behavior="scroll" bgcolor="#FF0000" direction="up" height="300" width="200" hspace="50" vspace="20" loop="-1" scrollamount="10" scrolldelay="100" onMouseOut="this.start()" onMouseOver="this.stop()">這是一個(gè)完整的例子</marquee>

該標(biāo)簽支持的屬性多達(dá)11個(gè):

align

設(shè)定<marquee>標(biāo)簽內(nèi)容的對(duì)齊方式

absbottom:絕對(duì)底部對(duì)齊(與g、p等字母的最下端對(duì)齊)
absmiddle:絕對(duì)中央對(duì)齊
baseline:底線對(duì)齊
bottom:底部對(duì)齊(默認(rèn))
left:左對(duì)齊
middle:中間對(duì)齊
right:右對(duì)齊
texttop:頂線對(duì)齊
top:頂部對(duì)齊

代碼如下:

<marquee align="absbottom">align="absbottom":絕對(duì)底部對(duì)齊(與g、p等字母的最下端對(duì)齊)。 </marquee><marquee align="absmiddle">align="absmiddle": 絕對(duì)中央對(duì)齊。 </marquee><marquee align="baseline">align="baseline": 底線對(duì)齊。 </marquee><marquee align="bottom">align="bottom": 底部對(duì)齊(默認(rèn))。 </marquee><marquee align="left">align="left": 左對(duì)齊。 </marquee><marquee align="middle">align="middle": 中間對(duì)齊。 </marquee><marquee align="right">align="right": 右對(duì)齊。 </marquee><marquee align="texttop">align="texttop": 頂線對(duì)齊。 </marquee><marquee align="top">align="top": 頂部對(duì)齊。 </marquee>

behavior

設(shè)定滾動(dòng)的方式:

alternate: 表示在兩端之間來回滾動(dòng)。

scroll: 表示由一端滾動(dòng)到另一端,會(huì)重復(fù)。

slide:  表示由一端滾動(dòng)到另一端,不會(huì)重復(fù)。

代碼如下:

<marquee behavior="alternate">alternate:表示在兩端之間來回滾動(dòng)。 </marquee><marquee behavior="scroll">scroll:表示由一端滾動(dòng)到另一端,會(huì)重復(fù)。</marquee><marquee behavior="slide">slide:  表示由一端滾動(dòng)到另一端,不會(huì)重復(fù)。</marquee>

bgcolor

設(shè)定活動(dòng)字幕的背景顏色,背景顏色可用RGB、16進(jìn)制值的格式或顏色名稱來設(shè)定。

代碼如下:

<marquee bgcolor="#006699">設(shè)定活動(dòng)字幕的背景顏色 bgcolor="#006699"</marquee><marquee bgcolor="RGB(10%,50%,100%,)">設(shè)定活動(dòng)字幕的背景顏色 bgcolor="rgb(10%,50%,100%,)"</marquee><marquee bgcolor="red">設(shè)定活動(dòng)字幕的背景顏色 bgcolor="red"</marquee>

direction

設(shè)定活動(dòng)字幕的滾動(dòng)方向

代碼如下:

<marquee direction="down">設(shè)定活動(dòng)字幕的滾動(dòng)方向direction="down":向下</marquee><marquee direction="left">設(shè)定活動(dòng)字幕的滾動(dòng)方向direction="left":向左</marquee><marquee direction="right">設(shè)定活動(dòng)字幕的滾動(dòng)方向direction="right":向右</marquee><marquee direction="up">設(shè)定活動(dòng)字幕的滾動(dòng)方向direction="up":向上</marquee> 

height

設(shè)定活動(dòng)字幕的高度

代碼如下:

<marquee height="500" direction="down" bgcolor="#CCCCCC">設(shè)定活動(dòng)字幕的高度height="500"</marquee>

width

設(shè)定活動(dòng)字幕的寬度

代碼如下:

<marquee width="500" bgcolor="#CCCCCC">設(shè)定活動(dòng)字幕的寬度width="500"</marquee>

hspace

設(shè)定活動(dòng)字幕里所在的位置距離父容器水平邊框的距離

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

設(shè)定活動(dòng)字幕里所在的位置距離父容器垂直邊框的距離

This controls the vertical(垂直) space around the display box.

代碼如下:

<marquee vspace="100" bgcolor="#CCCCCC">hspace="100"</marquee>

loop

設(shè)定滾動(dòng)的次數(shù),當(dāng)loop=-1表示一直滾動(dòng)下去,默認(rèn)為-1

代碼如下:

<marquee loop="-1" bgcolor="#CCCCCC">我會(huì)不停地走。</marquee><p>&nbsp;</p><marquee loop="2" bgcolor="#CCCCCC">我只走兩次哦</marquee>

scrollamount

設(shè)定活動(dòng)字幕的滾動(dòng)速度,單位pixels

代碼如下:

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

scrolldelay

設(shè)定活動(dòng)字幕滾動(dòng)兩次之間的延遲時(shí)間,單位millisecond(毫秒)

值大了會(huì)有一步一停頓的效果

代碼如下:

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

以上所述是小編給大家介紹的詳解html中的marquee屬性,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 观塘区| 桃源县| 临高县| 岑溪市| 宝应县| 广宗县| 武功县| 吴川市| 伊宁市| 当阳市| 葫芦岛市| 东乌| 蛟河市| 应用必备| 阜平县| 瑞安市| 金溪县| 湖口县| 静安区| 鹰潭市| 申扎县| 吉水县| 喀什市| 鱼台县| 崇文区| 七台河市| 灵寿县| 南京市| 文水县| 平度市| 河池市| 安远县| 岳西县| 栖霞市| 海城市| 石景山区| 瑞昌市| 临夏县| 清丰县| 宁海县| 正阳县|