標籤:zhiye 課程 超連結 網頁 魔獸
2016年11月10日,星期四。
今天利用了新的指令<!--網站超連結-->製作出更加完善的網頁導航條。
網站超連結:<a href="輸入超連結網址">-輸入內容-</a>
編碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title>魔獸職業預覽</title>
</head>
<style type="text/css">
body,ul{
margin: 0px;
padding: 0px;
}
#baohan{
width: 100%
height:60px;
background-color: red;
}
#zhiye{
height: 50px;
width: 1500px;
margin: 0 auto;
background-color: red;}
li{
width: 70px;
height: 50px;
background-color: red;
float: left;
list-style: none;
text-align: center;
line-height: 50px;
margin-right: 2px;}
li:hover{background-color: orange;}
a{text-decoration: none;}
</style>
<body>
<div id="baohan">
<ol id="zhiye">
<li><a href="https://www.wowchina.com/zh-cn/game/classes/demon-hunter">戰士</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/paladin">聖騎士</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/hunter">法師</li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/hunter">獵人</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/hunter">牧師</li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/hunter">薩滿</li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/death-knight">死亡騎士</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/druid">德魯伊</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/demon-hunter">惡魔獵手</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/warlock">術士</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/monk">武僧</a></li>
<li><a href="https://www.wowchina.com/zh-cn/game/classes/rogue">潛行者</a></li>
</ol>
</div>
</body>
</html>
完成圖,如下:
650) this.width=650;" src="http://s5.51cto.com/wyfs02/M01/8A/0C/wKiom1gkdHGhFBdfAADGdzaNIeU552.png-wh_500x0-wm_3-wmp_4-s_92858026.png" title="2016-11-10_211930.png" alt="wKiom1gkdHGhFBdfAADGdzaNIeU552.png-wh_50" />
實現了連結功能:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/8A/0D/wKiom1gkkCHTChxoAB2JC5emPTY340.png-wh_500x0-wm_3-wmp_4-s_738213283.png" title="2016-11-10_231746.png" alt="wKiom1gkkCHTChxoAB2JC5emPTY340.png-wh_50" />
利用target="blank"錨點功能實現<開啟全新網頁保留原網頁>的功能。
註:target(目標)預設值self
blank:開啟全新網頁保留原網頁
<body>
<div id="baohan">
<ol id="zhiye">
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/demon-hunter">戰士</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/paladin">聖騎士</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/hunter">法師</li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/hunter">獵人</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/hunter">牧師</li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/hunter">薩滿</li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/death-knight">死亡騎士</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/druid">德魯伊</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/demon-hunter">惡魔獵手</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/warlock">術士</a></li>
<li><a target="blank"href="https://www.wowchina.com/zh-cn/game/classes/monk">武僧</a></li>
<li><a target="blank" href="https://www.wowchina.com/zh-cn/game/classes/rogue">潛行者</a></li>
</ol>
</div>
(可看到開啟連結後原網頁未關閉),如下:
650) this.width=650;" src="http://s1.51cto.com/wyfs02/M01/8A/09/wKioL1gkksbTCTj9AB2KpZwoFK0227.png-wh_500x0-wm_3-wmp_4-s_2546369255.png" title="2016-11-10_232814.png" alt="wKioL1gkksbTCTj9AB2KpZwoFK0227.png-wh_50" />
本文出自 “12244251” 部落格,謝絕轉載!
學習PHP課程的第四天