Skip to content

This is one of our old lessons! Visit the Path page to see all of our latest courses.

Link to a specific section of your web page – HTML

Summary

To create a link to a specific section of your web page, use an anchor element with the href attribute and use the ID of another element on the page as the value (prefixed with a hash sign):

<a href="#last-section">Link text</a>

<!-- Other HTML code might be here -->

<h2 id="last-section">Header</h2>

Demo

Link to specific section demo

References

The Anchor element on MDN