文、意如
<marquee>ABC123</marquee>
屬性
- bgcolor="" #背景色
- width="" #寬
- height="" #高
- loop="5" #跑幾次
- direction=right/up/down #控制行進的方向
- behavior=slide文字碰到底邊就會停止/alternate左右碰撞 #控制行進的方式
- scrollamount="參數值" ;#速度設定可設定為數字,通常設定 1~10 的範圍,數字越大跑得越快。
<marquee bgcolor="yellow" width="50px" height="100" loop="5" direction="up" behavior="alternate">文字</marquee>

實作練習:
試著做一個跑馬燈
五張圖片 右邊跑到左邊 (碰到左邊底邊就會停止),五張圖片 下面跑到上面 (上下碰撞)

<html>
<head>
<title>網頁標題</title>
</head>
<body>
<center>
<marquee bgcolor="yellow" width="50%" height="100" behavior="slide">
<img src="images/1.jpg" width="100" height="100">
<img src="images/1.jpg" width="100" height="100">
<img src="images/1.jpg" width="100" height="100">
<img src="images/1.jpg" width="100" height="100">
<img src="images/1.jpg" width="100" height="100">
</marquee>
<marquee bgcolor="green" width="50%" height="500" direction="up" behavior="alternate">
<img src="images/1.jpg" width="50" height="50"><br>
<img src="images/1.jpg" width="50" height="50"><br>
<img src="images/1.jpg" width="50" height="50"><br>
<img src="images/1.jpg" width="50" height="50"><br>
<img src="images/1.jpg" width="50" height="50"><br>
</marquee>
</center>
</body>
</html>
Yiru@Studio - 關於我 - 意如