<!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實現