1 通過id
<a href="#m1"> 通過id獲取錨點</a>
<div style="width:100%;height:1000px"></div>
<div style=" height:100px; width:100%; background: red; id="m1"> 通過id獲取錨點</div>
2 通過 name name只能適用於a標簽
<a href="#m2"> 通過name獲取錨點</a>
<div style="width:100%;height:1000px"></div>
<a style=" display:block;height:200px; width:100%;background: blue; " name="m2"> 通過name獲取錨點</a>
3 通過js
<a href="#" onclick="javascript:document.getElementById('m3').scrollIntoView();"> 通過js獲取錨點</a>
<div style=" height:200px; width:100%; background:green" id="m3"> 通過js獲取錨點</div>