Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the <a> tag represent links, when a perfectly valid <link> tag exists?

Tags:

conventions

There's probably a historical reason for this, but I don't know where to start looking for where this might be documented.

Specifically, instead of the cryptic "anchor tag" with a "hypertext reference" (well, I suppose terminology was different back then):

<a href="https://stackoverflow.com">StackOverflow</a>

why didn't something like this happen?

<link to="https://stackoverflow.com">StackOverflow</link>

What exactly did "anchor" mean anyway?

like image 531
oink Avatar asked Dec 19 '22 15:12

oink


2 Answers

According to the W3 docs:

A link has two ends -- called anchors -- and a direction. The link starts at the "source" anchor and points to the "destination" anchor, which may be any Web resource (e.g., an image, a video clip, a sound bite, a program, an HTML document, an element within an HTML document, etc.).

I'm not an expert in the field, but I believe that it is merely because of the terminology at the time. Reading that article can provide more details about the definitions, but you may need to message the original authors or historians to provide a creditable answer.

like image 99
xes_p Avatar answered Apr 25 '23 14:04

xes_p


A was short for anchor, which could be a url or a named anchor (created with <a name="myanchor">text</a>). The text in my example would not be visually different, and another A tag could set its href to #myanchor. When clicked, the browser would scroll the named A tag to the top of the page, or at least ensure it was visible.

Link wasn't added until later, and it means something else semantically.

See http://www.w3schools.com/tags/tag_a.asp

As to why, I think only the Html group at the time could answer, but i'd guess that since you could link to another page or within the document, hyper linking wasn't all it could do. Or perhaps since bandwidth was more expensive, brevity had a higher value.

like image 31
Andy Avatar answered Apr 25 '23 13:04

Andy