Home ||| Extras ||| HTML ||| URL


HTML URLs:
Uniform Resource Locators

Or, WWW Addresses, Universal Document Identifiers (UDI), Universal Resource Identifiers (URI).


1: Anchor Links


Anchor links (<a >) must have an href (hypertext reference) attribute, with the URL as its value.

<a href="http://www.domain.dom/index.html">Link Text</a>


2: Absolute URLs


Absolute URLs include the:

  • Protocol scheme (http)
  • (usually) Server folder (www)
  • Server host domain name (domain)
  • Top-level domain hierarchy name (dom)
  • (and often) Top-level domain hierarchy country name abbreviation (HN)

<a href="http://www.domain.dom.hn/">Another Site</a>

There is no real top-level name "dom" or "hn"; they are used here as a general-purpose catch-all for the normal names (com, edu, org, gov, us, uk, de, et cetera [there's no etc name either, but just in case you might think there is, etc. is spelled out in full]).

Absolute URLs must be used when making an anchor link to a document that is not in the current site. Be sure to type them correctly, and test them afterwards.


3: Relative URLs


Relative URLs do not include the protocol or the server site names. Use only the local file structure to construct relative URLs.

From a page that is at the same hierarchical level as the folder-directory called stuff, links into the folder look like:

<a href="stuff/index.html">Stuff</a>

Most relative URLs will point to files or directories. The default file in a directory is often index.html, so
<a href="stuff/index.html">
will often mean the same as
<a href="stuff/">

Files that are within the same directory don't need the directory in the relative URL; links on the index.html page of the stuff directory might be:

<a href="otherstuff.html">Stuff Two</a>

<a href="morestuff.html">Stuff Three</a>

<a href="yetmorestuff.html">Stuff Four</a>


4: Targeted Anchor URLs


Local anchor links can point to targets within a page, or to targets on other pages. The following source anchor points to a target anchor added to the munchfonts image on this page:

<a href="#top">Top of the Page</a>

Target anchors use name instead of href. The following target anchor markup surrounds the heading for this page:

<a name="url"><h1>Uniform Resource Locators</h1></a>

The following source anchor points to the target anchor added to the heading for this page:

<a href="#url">Meaning of URL</a>

Source anchors use the # number sign before the name, to mark the link as a local or partial URL. Targeted anchor links use the name only, with no # number sign.