2010-02-12 97 views

回答

1

您可以使用定位標記。

使用name屬性時,<a>元素在HTML文檔中定義了一個命名錨。命名的錨不會以任何特殊的方式顯示。名稱屬性對讀者是不可見的。該屬性必須出現在查詢字符串的末尾。

命名錨語法:

<a name="label">Any content</a> 

鏈接語法命名錨:在HREF屬性

<a href="#label">Any content</a> 

定義鏈接到命名錨(http://www.mywebsite.com/mypage#label) 。

實施例:

HTML文檔內部的命名錨:

<a name="tips">Useful Tips Section</a> 

來自同一文檔的鏈接到有用的提示條:

<a href="#tips">Jump to the Useful Tips Section</a> 

鏈接到來自另一文件的有用提示部分:

<a href="http://www.w3schools.com/html_tutorial.htm#tips">Jump to the Useful Tips Section</a> 
相關問題