學習php的第四天

來源:互聯網
上載者:User

標籤:center   超連結   底線   圖片   

   今天是學習php的第四天。由於花了一天的時間來裝一個系統,而我對這個也並不是很瞭解,所以就不再贅述。只學習了如何設定連結。

   首先是幾個定義。.表示當前所在目錄,src圖片地址。載入超連結 <a href=...>。text-decoration意為連結裝飾,用於去除底線。

   下面是代碼。我用昨天的導航條為基礎,給每個標題都設定了連結。代碼如下。

   



   

<html>

<head>

<title></title>


<style>

div{height: 50px;width: 100%;background-color: blue;

}

li{

float: left;list-style: none;margin: 2px;height: 50px;line-height: 50px;

text-align: center; 


}

ul{background-color: blue;

margin: 0 auto;text-align: center;height: 50px;width: 800px;

}

li:hover{

background-color: green;

}

a{text-decoration: none ;color: black;

}


</style>

</head>

<body>

<div>

<ul>

<li><a target="_blank"href="http://www.baidu.com" >滾動</a></li>

<li><a target="_blank"href="http://www.huya.com" >直播</a></li>

<li><a target="_blank"href="http://tv.cctv.com" >調查</a></li>

<li><a target="_blank"href="http://y.qq.com" >排行</a></li>

<li><a target="_blank"href="http://www.sina.com" >國際</a></li>

</ul>

</div>

</body>

</html>




   還有如果想在跳轉網頁的時候想看到別的位置而不是頂部,可以給要跳轉到的網頁設定一個錨點,將連結給到錨點上。我用了轉行來將一行字推到了底部。代碼如下




   

<html>

<head>

<title></title>

<style type="text/css">

a{text-decoration: none ;

}

</style>


</head>

<body>

<a target="_blank" href="mc.html#b">2</a>

</body>

</html>


   這是第一頁的代碼,下面是跳轉頁的。



<html>

<head>

<title></title>

</head>

<body>

<h2>小偉說自己carrry<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></h2>

<h3 id="b">小偉在底部</h3>

</body>

</html>


   由於各種原因,今天唯寫這一點東西 。明天繼續!  



   

學習php的第四天

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.