What does 'href' stand for?


#1


https://www.codecademy.com/en/courses/learn-html-css/lessons/common-elements/exercises/links


I wonder what "href" actually stands for. "a" for instance stands for anchor, which is pretty straightforward.


<a href="http://www.google.com/>Google</a>


#2

A link in HTML terms is known as hypertext. That is the h in href. The ref part means reference.

The link element is <a></a>. Why a? That stands for anchor. Hypertext sends out a request for a given resource and once found, it plants an anchor whereby communication can travel back and forth along the imaginary cable that joins ship to its anchor point. Many of us old timers often called this a hook reference, which is more of a pun than tech speak. Get it, hook -> anchor?


#3

Love it! Thanks for the fast and detailed response. Very insightful!

It just seems strange that "href" would also be an attribute to the link-tag, though. A css file does not include hypertext, does it?


#4

You're welcome.

Also note that the ht in http is hyper text. as in hyper text transfer protocol. It is also the ht in HTML. Hyper Text Markup Language.


#5

The way I understand from the lesson, hypertext refers to text that includes links, right? CSS files do not include links. Why would they be linked via <link href='file.css'/>? Shouldn't it be <link src='file.css'/> instead?


#6

for a better understanding
read
http://www.w3.org/TR/html4/struct/links.html


#7

It is an href because it is a link to an external resource that does not load into the page. It loads in a metadata and is then parsed into the DOM.

src attributes are only found on object requests that can be embedded in the <body></body> element. We cannot embed images in the <head></head> and we cannot embed <link></link> in the <body></body> To confuse this, <script></script> may be embedded in either section. Those in the HEAD execute immediately, those at the end of BODY execute when the DOM content is loaded.


#8

That makes perfect sense now. Thanks again!


#9

Also quite helpful. Thanks, Leonhard.


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.