Part of the Series: How To Build a Website With HTML

This tutorial series will guide you through creating and further customizing this website using HTML, the standard markup language used to display documents in a web browser. No prior coding experience is necessary but we recommend you start at the beginning of the series if you wish to recreate the demonstration website.

At the end of this series, you should have a website ready to deploy to the cloud and a basic familiarity with HTML. Knowing how to write HTML will provide a strong foundation for learning additional front-end web development skills, such as CSS and JavaScript.

This tutorial will walk you through the steps of adding hyperlinks to your webpage.

Hyperlinks can be added to text or images with the anchor link element <a>. The <a> tag requires the attribute href, which is used to specify the destination link. The <a> element is used like this:

<a href="">The text you want to link</a>

Try adding the code snippet below to your “index.html” file and changing the sample highlighted text with a real link, such as

<a href="">The text you want to link</a>

(If you have not been following the tutorial series, you can review instructions for setting up an index.html file in our tutorial Setting Up Your HTML Project. Save the file and load it in your browser.

You should receive an output like this:


You can also link images by wrapping an image element with an <a> element like so:

<a href="">The text you want to link
<img src="">

Try testing the code snippet in your browser to check that it works. You should now understand how to add hyperlinks to text and images on your webpage.


Creative Commons License