代碼:<div align="center"> <table align="center" background="http://img7.ph.126.net/bd6zz97pDq4GzNwYklqLAA==/3396277068991311037.gif" bgcolor="#ff0000" border="15" bordercolor="purple" cellpadding="0" cellspacing="10" height="0" style="width:650px;height:5px;" width="400"> <tbody> <tr> <td> <table background="" bgcolor="#00ff00" border="6" bordercolor="yellow" cellpadding="0" cellspacing="2" width="650"> <tbody> <tr> <td> <table background="http://img4.oldkids.cn/upload/2017/09/30/blog_20170930151949848.gif" border="10" bordercolor="#a00000" height="500" width="710"> <tbody> <tr> <td><br /> <marquee direction="right" height="400" scrollamount="4" scrolldelay="80" style="height: 400px; width: 690px;" width="690"><img src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_1_2022082509270866.png" /></marquee></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div>
代碼解析:代碼中的移動(dòng)標(biāo)簽是<marquee direction="right" height="400" scrollamount="4" scrolldelay="80" style="height: 400px; width: 650px;" width="650"><img src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_1_2022082509270866.png" /></marquee>其中的style="height: 400px; width: 650px;"是圖片的規(guī)格屬性,它是css樣式,屬性與屬值用冒號(hào)連接。height="400"和width="650",它們的屬性與屬值之間是用等號(hào)連接的,而且數(shù)字后面沒有px ,它們是移動(dòng)范圍屬性。要記住它們的特征,可別搞錯(cuò)呀!因?yàn)槲覀兂3R{(diào)整移動(dòng)范圍。
(十八)圖片縱向(向上或向下)移動(dòng):
代碼:<div align="center"> <table align="center" background="http://img7.ph.126.net/bd6zz97pDq4GzNwYklqLAA==/3396277068991311037.gif" bgcolor="#ff0000" border="15" bordercolor="purple" cellpadding="0" cellspacing="10" width="550"> <tbody> <tr> <td> <table background="" bgcolor="#00ff00" border="6" bordercolor="yellow" cellpadding="0" cellspacing="2" width="650"> <tbody> <tr> <td> <table align="center" background="http://img2.oldkids.cn/upload/2017/10/04/blog_20171004190531769.gif" border="0" bordercolordark="#27093b" bordercolorlight="#4e1276" cellpadding="0" cellspacing="0" class="ke-zeroborder" height="450" width="700"> <tbody> <tr> <td width="100%"></embed> <table> <tbody> <tr> <td><marquee direction="up" height="450" scrollamount="3" scrolldelay="100" style="height: 450px; width: 670px;" width="670"> <p align="center"><img height="450" src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_2_20220825092708316.png" /></p> </marquee></td> <td width="35%"> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div>
代碼解析:代碼中的移動(dòng)標(biāo)簽是<marquee direction="up" height="450" scrollamount="3" scrolldelay="100" style="height: 450px; width: 670px;" width="670"><p align="center"><img height="450" src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_2_20220825092708316.png" /></p></marquee>其中的style="height: 450px; width: 670px;"是圖片的規(guī)格屬性,它是css樣式,屬性與屬值用冒號(hào)連接。height="450"和width="670",它們的屬性與屬值之間是用等號(hào)連接的,而且數(shù)字后面沒有px ,它們是移動(dòng)范圍屬性。要記住它們的特征,可別搞錯(cuò)呀!因?yàn)槲覀兂3R{(diào)整移動(dòng)范圍。
(十九)圖片斜向(45o角)移動(dòng):
代碼:<div align="center"><tbody> <tr> <td> <table background="" bgcolor="#00ff00" border="6" bordercolor="yellow" cellpadding="0" cellspacing="2" width="650"> <tbody> <tr> <td> <table background="http://img2.oldkids.cn/upload/2017/10/04/blog_20171004143206529.gif" border="10" bordercolor="#a00000" width="710"> <tbody> <tr> <td> <div align="center"><marquee><marquee direction="down" height="500" scrollamount="6" style="height: 500px;"><img src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_3_20220825092708675.jpg" /></marquee> </marquee></div> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div>
代碼解析:這里使用的是向下移動(dòng)的標(biāo)簽,而在此標(biāo)簽前加了一個(gè)<marquee>,你知道它是干什么的嗎?提醒初學(xué)代碼的朋友,它不含屬性代碼并不等于沒有屬性,我們?cè)谇懊嬲f過,基本的必須有的屬性屬值,若未設(shè)置,就意味著采用默認(rèn)的。我們知道,默認(rèn)的移動(dòng)方向是left,默認(rèn)的移動(dòng)速度是6,因?yàn)檫x取了默認(rèn),所以免寫,你知道了這些,就明白了為什么前面加個(gè)<marquee>,圖片就能斜向移動(dòng)了。
(二十)圖片飄游(上下左右)移動(dòng):
代碼:<div align="center"> <table align="center" background="http://img7.ph.126.net/bd6zz97pDq4GzNwYklqLAA==/3396277068991311037.gif" bgcolor="#ff0000" border="15" bordercolor="purple" cellpadding="0" cellspacing="20"> <tbody> <tr> <td> <table bgcolor="#00ff00" border="6" bordercolor="yellow" cellpadding="5" cellspacing="2"> <tbody> <tr> <td><marquee behavior="alternate" direction="down" height="440" scrollamount="1" scrolldelay="1" style="width: 710px; height: 440px;"> <marquee behavior="alternate" direction="right" scrollamount="1" scrolldelay="1" style="width: 760px; height: 500px;" width="760"><img src="http://image109.360doc.com/DownloadImg/2022/08/2509/250879754_4_20220825092708878.jpg" /> </marquee>/marquee></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div>
代碼解析:使用雙標(biāo)簽(一個(gè)是縱向移動(dòng)標(biāo)簽,一個(gè)是橫向移動(dòng)標(biāo)簽)控制,移動(dòng)速度要低,移動(dòng)范圍要小,方能獲此效果。