1. 程式人生 > >Html鏈接標簽:

Html鏈接標簽:

true clas img spa src .html div rdquo 提示

<a>標簽可以在網頁上定義一個鏈接地址,它的常用屬性有:

(1)href屬性 定義跳轉的地址

(2)title屬性 定義鼠標懸停時彈出的提示文字框 (定義鼠標懸停時,彈出的提示框中的文字)

(3)target屬性 定義鏈接窗口打開的位置

target=”_self”缺省值,新頁面替換原來的頁面,在原來位置打開

target=”_blank”新頁面會在新開的一個瀏覽器窗口打開

<a href=”#”></a> <!-- # 表示鏈接到(當前)頁面頂部 -->

代碼:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鏈接</title>
</head>
<body>
    <h1>網頁鏈接</h1>

    <!-- 文字鏈接 -->
    <a href="圖片網頁.html">進入 圖片網頁</a>

    <a href="https://www.baidu.com">進入 百度</a> <br />

    <!-- 圖片鏈接:把文字換成圖片即可 -->
    <a href="https://www.baidu.com" title="進入百度網站" target="_blank"><img src="images/baidu_jgylogo3.gif" alt="百度logo" /></a>

</body>
</html>

頁面顯示效果:

技術分享圖片

Html鏈接標簽: