HTML- 锚点实例

 1 <!DOCTYPE HTML>
 2 <html>
 3     <head>
 4         <meta charset='utf-8'>
 5         <title>锚点实例</title>
 6     </head>
 7     <body>
 8         <h1>锚点实例</h1>
 9         <h3 id = 'dingbu'>这是顶部</h3>
10         <a href = '#one'>第一章</a>
11         <a href = '#two'>第二章</a>
12         <a href = '#three'>第三章</a>
13         <a href = '#four'>第四章</a>
14         
15         <h1 id = 'one'>第一章的内容</h1>
16         <div style ='500px;height:600px;border:solid 2px blue'></div>
17     
18         <h1 id = 'two'>第二章的内容</h1>
19         <div style ='500px;height:600px;border:solid 2px blue'></div>
20     
21         <h1 id = 'three'>第三章的内容</h1>
22         <div style ='500px;height:600px;border:solid 2px blue'></div>
23         
24         <h1 id = 'four'>第四章的内容</h1>
25         <div style ='500px;height:600px;border:solid 2px blue'></div>
26     
27         <a href = '#dingbu'>回到顶部</a>
28     
29     </body>
30 </html>
原文地址:https://www.cnblogs.com/zhangboblogs/p/8053338.html