Why is a link in HTML the <a> tag?

Why is a link in HTML the <a> tag? Why is it not the <link> tag? Also, since I know it exists, what is the <link> tag used for?

Thanks for all answers!

5 Likes

Nice question!

The <a> tag stands for anchor. The tag is used to link to external style sheets. The tag defines a link between a document and an external resource.

I hope this helps =)

4 Likes

The anchor tag is not for linking to style sheets, that would be the <link> element which can only be used in the HEAD.

Anchor elements need not only link to external resources, such as other sites, but also link to other documents on the current site. What’s more we use them to link to page fragments by their id.

<div id="summary">

</div>

<a href="#summary">Summary</a>

In the early days before the advent of id attributes, we used to identify page fragments by giving them an anchor, which is where the term comes from.

<div>
  <a name="summary"></a>          <!-- anchor -->

</div>

<a href="#summary">Summary</a>    <!-- hyperlink -->

The Anchor element in HTML

Note that the above article is very old (~1995) but is still worth reading. A good lot of what we use today has its origins in the early iterations of HTML, and may still apply.

5 Likes

Oops. I’ll fix it. Thanks for catching my mistake @mtf!

4 Likes