Skip to content

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

Link to an external website – HTML

Summary

To create a link to another website, use the anchor element with the href attribute.

<a href="http://example.com/">External link</a>

To see what this element looks like in the browser, click the link in the Demo section below.

Details

The process of creating a link to an external website is similar to creating a link to one of your own pages. The difference is that links to external websites should use absolute URLs (meaning they should include the http:// or https:// protocols with the URL and the domain name).

Demo

Note: the external link will not work in the CodePen below, but it will work in your own index.html file.

External link demo

References

The Anchor element on MDN