Hyperlinks: link two web pages

One of the principles on which the WWW is based is the linking of documents. So let’s learn how to link two web pages. This is based on the concept of Hypertext, which means something like presenting documents that can be branched or executed when requested. This definition dates back to 1963 by the sociologist Theodore Holm Nelson, long before the WWW was born.

One of the forms of hypertext are hyperlinks or hyperlinks or links (the best-known vulgar form of the three).

So if we want to make web pages using HTML, the first thing we have to learn, or one of the first things, is how to make links.

To do this we have to rely on the a element
which comes from the English «anchor» (anchor) and is one of the base elements of the HTML language.

Attributes of element a to link two web pages

The attributes of the a element
that we have to know to generate the links are the following:


  • href
    , where the destination page (or resource) must be specified. This may be with the absolute address or relative to the link we want to put.

  • target
    , where we will indicate the destination frame of the page. If we want the link to open on the same page, we leave it empty.

  • title
    , link title. It will be useful for customers to interpret what the displayed link means. It is usually useful in SEO issues.

  • type
    , which specifies the MIME type of the linked resource, that is, if it is a page, if it is an image, a video file,…, helping the web browser to determine how to handle the content that is being linked to. This attribute is especially useful when linking to resources that are not standard web pages.

Code to link pages

Now we get to work to be able to write our HTML code for this we assume that we are on pageA.htm and we want to link and therefore open pageB.htm. In HTML code will be something like this:

<a href="pageB.htm" title="My link">My link</a>

In this simple way we have managed to link two web pages using HTML and thus continue weaving this immense network that is the Internet.

Leave a Comment