?
This document uses PHP Chinese website manual Release
已廢棄
此功能已過(guò)時(shí)。雖然它可能在某些瀏覽器中仍然有效,但由于可以在任何時(shí)候刪除它,所以不鼓勵(lì)使用它。盡量避免使用。
HTML marquee 元素(<marquee>)
用來(lái)插入一段滾動(dòng)的文字。你可以使用它的屬性控制當(dāng)文本到達(dá)容器邊緣發(fā)生的事情。
<marquee>
元素已經(jīng) 過(guò)時(shí),請(qǐng)不要再使用。盡管一些瀏覽器仍然支持它,但它不是必須的。
behavior
設(shè)置文本在 marquee 元素內(nèi)如何滾動(dòng)??蛇x值有 scroll,slide
和 alternate。
如果未指定值,默認(rèn)值為 scroll。
bgcolor
通過(guò)顏色名稱或十六進(jìn)制值設(shè)置背景顏色。
direction
設(shè)置 marquee 內(nèi)文本滾動(dòng)的方向??蛇x值有 left
,right
,up
anddown。
如果未指定值,默認(rèn)值為 left。
height
以像素或百分比值設(shè)置高度。
hspace
設(shè)置水平邊距。
loop
設(shè)置 marquee 滾動(dòng)的次數(shù)。如果未指定值,默認(rèn)值為 ?1,表示 marquee 將連續(xù)滾動(dòng).
scrollamount
設(shè)置每次滾動(dòng)時(shí)移動(dòng)的長(zhǎng)度(以像素為單位)。默認(rèn)值為 6。
scrolldelay
設(shè)置每次滾動(dòng)時(shí)的時(shí)間間隔(以毫秒為單位)。默認(rèn)值為 85。請(qǐng)注意, 除非指定 truespeed 值,否則將忽略任何小于 60 的值,并改為使用 60。
truespeed
默認(rèn)情況下,會(huì)忽略小于60的scrolldelay值。如果存在truespeed,那些值不會(huì)被忽略。
vspace
以像素或百分比值設(shè)置垂直邊距。
width
以像素或百分比值設(shè)置寬度。
onbounce
當(dāng) marquee 滾動(dòng)到結(jié)尾時(shí)觸發(fā)。它只能在 behavior 屬性設(shè)置為 alternate 時(shí)觸發(fā)。
onfinish
當(dāng) marquee 完成 loop 屬性設(shè)置的值時(shí)觸發(fā)。它只能在 loop 屬性設(shè)置為大于 0 的某個(gè)數(shù)字時(shí)觸發(fā)。
onstart
當(dāng) marquee 開始滾動(dòng)時(shí)觸發(fā)。
start開始滾動(dòng) marquee。stop停止?jié)L動(dòng) marquee。
<marquee>This text will scroll from right to left</marquee> <marquee direction="up">This text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate">This text will bounce </marquee> </marquee>
規(guī)范 | 狀態(tài) | 評(píng)論 |
---|---|---|
HTML Living Standard該規(guī)范中'<marquee>'的定義。 | 生活水平 | 為了向后兼容,使其過(guò)時(shí)而傾向于CSS,但是定義了它的預(yù)期行為。 |
HTML5該規(guī)范中'<marquee>'的定義。 | 建議 | 為了向后兼容,使其過(guò)時(shí)而傾向于CSS,但是定義了它的預(yù)期行為。 |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
behavior | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
bgcolor | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
direction | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
height | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
hspace | ? | (Yes) | 3 | ? | ? | ? |
loop | ? | (Yes) | 3 | ? | ? | ? |
scrollamount | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
scrolldelay | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
truespeed | No | (Yes) | 3 | 4 | No | No |
vspace | ? | (Yes) | 3 | ? | ? | ? |
width | 1 | (Yes) | 1 | 2 | 7.2 | 1.2 |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | ? | ? | (Yes) | 1 | ? | ? | ? |
behavior | ? | ? | (Yes) | 1 | ? | ? | ? |
bgcolor | ? | ? | (Yes) | 1 | ? | ? | ? |
direction | ? | ? | (Yes) | 1 | ? | ? | ? |
height | ? | ? | (Yes) | 1 | ? | ? | ? |
hspace | ? | ? | (Yes) | 3 | ? | ? | ? |
loop | ? | ? | (Yes) | 3 | ? | ? | ? |
scrollamount | ? | ? | (Yes) | 1 | ? | ? | ? |
scrolldelay | ? | ? | (Yes) | 1 | ? | ? | ? |
truespeed | ? | ? | (Yes) | 3 | ? | ? | ? |
vspace | ? | ? | (Yes) | 3 | ? | ? | ? |
width | ? | ? | (Yes) | 1 | ? | ? | ? |