Home > Net >  How to make an Anchor tag to redirect to a particular section of another html page?
How to make an Anchor tag to redirect to a particular section of another html page?

Time:01-18

I want to know what i should put in the href="" section of the tag so that, when i click on it, it should take me to a particular section of another html page.

i only know that if i put the id of a section as href, then it should take me to a section of the same page. But what about other page

CodePudding user response:

If you want to go to a specific section in the same page, create a hyperlink by using the id of the link target, preceded by #:

<a href="#section">Jump to the part of the page with the “section” id</a>

If you want to go a specific section in another page, the same way but after the page link:

Link to another page in the same domain:

<a href="/another-page.html#section">Go to the HTML Links in our website.</a>

Link to another page in different domain:

<a href="https://en.wikipedia.org/wiki/Main_Page#wikipedia">Go to the main page of Wikipedia</a>
  • Related