Learn to use hyperlinks to connect web pages : CREATING A HYPERLINK

Hyperlinks are an important skill to master when building websites as they let the user easily access pieces of content.

Let’s create a web page with a hyperlink.

1) Open up your text-editing program.

Create a new HTML file called links.html.

Type this code into your new file:

<!DOCTYPE html>
<html>
<head>
 <title>Links</title>
</head>
<body>
</body>
</html>

2) Let’s make our hyperlink.

Add an anchor < a > tag with an empty href attribute to the < body > of your page.

Your code will look like this:

<body>
 <a href=" "></a>
</body>

3) Choose a word or phrase to be the text for your hyperlink on your web page.

Put it between your opening and closing < a > tags.

Your code will look like this:

<body>
 <a href=" ">Click here</a>
</body>

4) Now choose the URL you want your hyperlink to connect to.

Set it as the value of your href attribute.

Your code will look like this:

<body>
 <a href="https://www.miltonmarketing.com">
 Click here</a>
</body>

5) Save your HTML file and open it in your web browser.

You will see the text between your < a > tags displayed on screen.

When you click the hyperlink text your web browser will link to your URL.

Sample output of above code:


Click here

Try clicking your newly made link. Notice how it takes over your current window/session. We will get into other tabs/windows shortly.