1、作用: 跑馬燈
HTML marquee 元素(<marquee>) 用來(lái)插入一段滾動(dòng)的文字。你可以使用它的屬性控制當(dāng)文本到達(dá)容器邊緣發(fā)生的事情。
由于marquee標(biāo)簽現(xiàn)在用得是越來(lái)越少了,所以滾動(dòng)效果的做法大多也都改用javascript來(lái)實(shí)現(xiàn)了
2、格式:<marquee>內(nèi)容</marquee>
3、屬性:
- direction: 設(shè)置滾動(dòng)方向 left/right/up/down
- scrollamount: 設(shè)置滾動(dòng)速度, 值越大就越快
- loop: 設(shè)置滾動(dòng)次數(shù), 默認(rèn)是-1, 也就是無(wú)限滾動(dòng)
- behavior: 設(shè)置滾動(dòng)類型 slide滾動(dòng)到邊界就停止, alternate滾動(dòng)到邊界就彈回
注意點(diǎn): - marquee標(biāo)簽不是W3C推薦的標(biāo)簽, 在W3C官方文檔中也無(wú)法查詢這個(gè)標(biāo)簽, 但是各大瀏覽器對(duì)這個(gè)標(biāo)簽的支持非常好
<body>
<!--
作用: 是包含的文本或者內(nèi)容有不同樣式的運(yùn)動(dòng)/動(dòng)畫
格式:
<marquee>內(nèi)容</marquee>
屬性:
direction: 設(shè)置滾動(dòng)方向 left/right/up/down
scrollamount: 設(shè)置滾動(dòng)速度, 值越大就越快
loop: 設(shè)置滾動(dòng)次數(shù), 默認(rèn)是-1, 也就是無(wú)限滾動(dòng)
behavior: 設(shè)置滾動(dòng)類型 slide滾動(dòng)到邊界就停止, alternate滾動(dòng)到邊界就彈回
-->
<!--1方向 -->
<marquee width="100" height="100" bgcolor="green" direction="left"> 放血大甩賣!!!</marquee>
<marquee width="100" height="100" bgcolor="green" direction="right"> 放血大甩賣!!!</marquee>
<marquee width="100" height="100" bgcolor="green" direction="up"> 放血大甩賣!!!</marquee>
<marquee width="100" height="100" bgcolor="green" direction="down"> 放血大甩賣!!!</marquee>
<hr>
<!-- 2.不同滾動(dòng)速度 -->
<marquee width="100" height="100" bgcolor="green" direction="up" scrollamount="1"> 放血大甩賣!!!</marquee>
<br>
<marquee width="100" height="100" bgcolor="green" direction="down" scrollamount="100"> 放血大甩賣!!!</marquee>
<hr>
<!--3.是否循環(huán)-->
<marquee width="100" height="100" bgcolor="green" direction="right" loop="2"> 放血大甩賣!!!</marquee>
<br>
<marquee width="100" height="100" bgcolor="green" direction="right" loop="1"> 放血大甩賣!!!</marquee>
<!--4.滾動(dòng)類型-->
<marquee width="300" height="100" bgcolor="green" direction="right" behavior="slide"> 放血大甩賣!!!</marquee>
<marquee width="300" height="100" bgcolor="green" direction="left" behavior="alternate"> 放血大甩賣!!!</marquee>
</body>

圖片.png