Linking In HTML

I don’t understand linking in HTML, no matter how many times, I redo the exercise. I need an explanation about linking. Ontop of this, can someone also explain to me about about.html, contact.html, index.html.

Those are three common pages on most websites. index.html is the Home page when it is on the root of the site.

https://www.codecademy.com/index.html

The above is the URL (Universal Resource Locator) to the home page of Codecademy. The server will default to that resource if it is not in the URL:

https://www.codecademy.com/

That URL will still lead to the Home page.

about.html would be the page where you describe the website for readers/visitors and search engines. contact.html is the page where you would put physical address, if it is a business or public facility, for instance, and where one would find the phone number(s) and any other contact information. Most typically one will find the relevant email addresses of the site on that page.

Linking is how we connect to pages on the site or off the site.

<a href="https://www.codecademy.com/">Codecademy</a>

The above is an example of a link to Codecademy’s Home page. The a is short for, anchor. href is the attribute where we write the URL of the page we wish to link to. It is short for ‘http reference’ or as some might describe it, hook reference. When a user clicks the link in the page, it will immediately send a request to the server where that URL resolves to.

Try it:

Codecademy

If you are logged into the main site, that link will probably open on YOUR home page in your profile. Codecademy’s server will have rerouted it to,

https://www.codecademy.com/learn
3 Likes