Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

Link to the top of your web page – HTML

Length: 10 minutes

Summary

<a href="#top">Link to top</a>

<a href="#">Link to top</a>

Details

You can create a link to the top of your web page by using #top or # for the href value. You don’t have to have an element with the id top for this to work.

<!-- Other code goes here... -->
<a href="#top">Link to top</a>

<a href="#">Link to top</a>

Demo

Exercises

Try recreating the HTML code from the Demo section. Then try customizing the text inside the link.

References

The Anchor element on MDN

Back to: HTML Course > HTML Links