< a >标签可以在网页上定义一个链接地址,通过href属性定义跳转的地址,通过title属性定义鼠标悬停时弹出的提示文字框。
<a href="#"></a> <!-- # 表示链接到页面顶部 -->
<a href="http://wxedtech.com/" title="跳转的无限空间">无限空间</a>
<a href="2.html">测试页面2</a>
锚点:定义页面内滚动跳转
页面内定义了“id”,可以通过a标签链接到它的页面滚动位置,前提是页面要足够高,有滚动条,且元素不能在页面顶部
<a href="#mao1">标题一</a>
......
......
<h3 id="mao1">跳转到的标题</h3>
属性:
href必须,指的是链接跳转地址
target: 表示链接的打开方式: _blank 新窗口
title属性定义鼠标悬停时弹出的提示文字框
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>链接</title>
<style>
#a{
height: 800px;
background: green;
}
#b{
height: 800px;
background: red;
}
#c{
height: 800px;
background: pink;
}
#d{
height: 800px;
background: yellow;
}
}
</style>
</head>
<body>
<!-- <a href="https://www.baidu.com" target="_blank">百度</a>
<br>
<a href="https://www.sina.com.cn">新浪</a>
<br>
<a href="https://www.yezhulu.co/"><img src="../32397.jpg" alt="大美女"></a> -->
<a href="#a">一楼</a>
<a href="#b">二楼</a>
<a href="#c">三楼</a>
<a href="#d">四楼</a>
<div id ="a">
儿童用品
</div>
<div id ="b">
夫妻用品
</div>
<div id = "c">
老人用品
</div>
<div id =" d">
情趣用品
</div>
</body>
</html>