溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

HTML5中怎么實現(xiàn)文字輪滾功能

發(fā)布時間:2021-08-07 17:05:57 來源:億速云 閱讀:168 作者:Leah 欄目:web開發(fā)

這篇文章將為大家詳細講解有關HTML5中怎么實現(xiàn)文字輪滾功能,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。

marquee標簽是實現(xiàn)文字輪滾的大功臣

常用屬性如下:

directory 指明輪滾方向(默認向左)

behavior  指明輪滾方式(默認是scroll)

Hspace    指明元素到區(qū)域的水平距離

Vspace    指明元素到區(qū)域的垂直距離

loop      指明循環(huán)次數(shù)(默認-1表示無限循環(huán))

下面是我做的一個小栗子,大家可以試一試哦

<html>

    <head>

        <title> 文字輪滾</title>

        <meta charset="utf-8">

    </head>

    <body>

    <p align=center><marquee Hspace=6 scrollamount=3 width=200 height=40 bgcolor=red scrolldelay=1 behavior="scroll" directory="right">我是Cabby****人送外號白菜姐</marquee></p> 

    <p align=center><marquee Hspace=6 scrollamount=5 width=200 height=40 bgcolor=yellow scrolldelay=0 behavior=alternate>啦啦啦啦啦啦啦</marquee></p>

    <p align=center><marquee Hspace=6 scrollamount=3 width=200 height=40 bgcolor=red scrolldelay=1 behavior="scroll" directory="right" loop=-1>我是Cabby****人送外號白菜姐</marquee></p>

     <p align=center><marquee Hspace=6 scrollamount=5 width=200 height=40 bgcolor=yellow scrolldelay=0 behavior=alternate loop=-1>啦啦啦啦啦啦啦</marquee></p>

    <p align=center><marquee Hspace=6 scrollamount=3 width=200 height=40 bgcolor=red scrolldelay=1 behavior="scroll" directory="right">我是Cabby****人送外號白菜姐</marquee></p>

    </body>

</html>

關于HTML5中怎么實現(xiàn)文字輪滾功能就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI