<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
</head>
<style>
.fg{
margin: 700px;
}
</style>
<body>
<h3 class="title" id="t">a标签的定向跳转</h3>
<ul>
<li id="one">跳转一</li>
<li class="two">跳转二</li>
<li id="three">跳转三</li>
<li name="fofo">跳转四</li>
</ul>
<p class="fg"></p>
<a href=".one">>>>>跳到一</a> #404 Not Found
<hr>
<a href=".two">>>>>跳到二</a> #404 Not Found
<hr>
<a href="#three">>>>>跳到三</a> #成功跳转
<hr>
<a href="#one">>>>>跳到一</a> #成功跳转
</body>
</html>
总结:a标签在同一页面实现定向跳转,只能用id作为href实现