Linking to a Specific Part on Another Page in HTML

Linking to a specific part of a page on a website can be achieved with the same technique as used for linking to a specific part on the same page, as long as the part or section to be linked to on a page has a unique identification and it is known. All that is required is to add the identifier to the end of the link to the page. The URL can be relative or absolute. If the page in on the same website, then relative URL can be used, but if the page is on another website, it has to be absolute. For example, if the URL for a
page is “http://www.example.com/glossary.html” and the section to link to is identified as ”instruction_video,” using the id or name attribute, the link to the section would be written in one of the following ways:

<a href=http://www.example.com/glossary.html#instru- ction_video>Instruction video</a>

<a href=“glossary.html#instruction_video”>Instruction video</a>

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *