How to create a link to an anchor in HTML?
To make a link to a given place in an HTML page, it is necessary to create an anchor. To do this, you must insert an identifier (with the id
attribute) at the desired location. Here are some examples:
<h2 id="subtitle">...</h2>
<div id="top-of-div">...</div>
<td id="row-of-table">...</td>
All you have to do is link to this anchor by placing the hash tag (#) followed by the anchor's ID:
<a href="#subtitle">...<a>
<a href="#top-of-div">...</a>
<a href="#row-of-table">...</a>
If the anchor is on another page, simply add the hash tag (#) followed by the identifier at the end of the URL:
<a href="http://example.com#subtitle">...<a>
<a href="http://example.com#top-of-div">...</a>
<a href="http://example.com#row-of-table">...</a>
To make a link to a given place in an HTML page, it is necessary to create an anchor. To do this, you must insert an identifier (with the id
attribute) at the desired location. Here are some examples:
<h2 id="subtitle">...</h2>
<div id="top-of-div">...</div>
<td id="row-of-table">...</td>
All you have to do is link to this anchor by placing the hash tag (#) followed by the anchor's ID:
<a href="#subtitle">...<a>
<a href="#top-of-div">...</a>
<a href="#row-of-table">...</a>
If the anchor is on another page, simply add the hash tag (#) followed by the identifier at the end of the URL:
<a href="http://example.com#subtitle">...<a>
<a href="http://example.com#top-of-div">...</a>
<a href="http://example.com#row-of-table">...</a>
# | ID | Query | URL | Count |
---|