demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

HTML Links

There are two main kinds of links. Both use the <a> tag, but differ in how they resolve the path to the resource being linked to.

First, be aware that you can link to anything. Most links will be to other web pages, but you can also link to PDF files, images, .zip archives, or anything else. If the browser can handle the linked media (either by itself or through co-operating with a plugin) it will display it - otherwise, the user will be prompted to download and save the file.

Second, be aware that while we are assuming that you will be linked to an HTTP resource, this need not always be the case. Other web protocols can also be used within the <a> tag, including FTP, RTSP, and many others.

To determine the kind of link you will use, you need to answer a series of simple questions:

  • Is the resource you are linking to local to the page you are linking from? i.e., does it exist in the same website? If the answer is yes, you will be using a local or relative link (both terms refer to the same form of link.)

  • Alternatively, is the thing you are linking outside of your control, i.e. outside your website? If the answer is yes, you will be using a remote or absolute link (again, both terms are synonyms for each other).

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.