- What is the World Wide Web?
- Introduction to URIs
- Fragment identifiers
- Relative URIs
- URI Usability
What is the World Wide Web? (Technically speaking)
The World Wide Web or simply Web is an information resources network.
It is based on three mechanisms to make these resources readily available anywhere:
- A naming scheme (URIs) for locating resources.
- Protocols (HTTP, FTP, etc.) for access named resources.
- Hypertext (HTML) for easily formatting and navigate among resources.
The ties between these mechanisms become clear throughout the HTML specification.
Interested in WWW History? Follow the links in WWW Unofficial History article.
Introduction to URIs
Every single resource available on the Web (HTML document, image, video clip, program, etc.) is uniquely identified by an address encoded into a Universal Resource Locator (URI).
URIs consists of four pieces:
<scheme name> : <hierarchical part> [ ? <query> ] [ # <fragment> ]
- The scheme name, usually concerns about the kind of the resource and how to access them (protocol).
- The hierarchical part, usually concerns about identifying
the resource. It has two parts:
- The name of the machine (or user) hosting the resource.
- The name of the resource itself, given as a path.
- The query part may provide some additional identification information (not hierarchical).
- The fragment part may provide some additional identification information (to a secondary resource).
Consider the following URI:
This URI may be read as follows:
There is a document (w3c-compliant-xhtml-valid.html) available via the HTTP protocol.
Residing on the machine formidable.typo3.ug.
Accessible by the path "/features/".
Other schemes may be seen in HTML documents including "mailto" for email and "ftp" for FTP.
Here is another example of a URI. This one refers to a user's mailbox:
...this is text... For all comments, please send email to <a href="mailto:email@example.com">MarcRic</a>.
The term "URL" is much more familiar then "URI".
URLs form a subset of the more general URI naming scheme.
Some URIs refers to a location within a resource. This kind of URI ends with "#" followed by an anchor identifier (called the fragment identifier. For instance, here is a URI pointing to an anchor named Generic_syntax:
A relative URI doesn't contain any naming scheme information. Its path generally refers to a resource on the same machine as the current document. Relative URIs may contain relative path components (e.g., ".." means one level up in the hierarchy defined by the path), and may contain fragment identifiers.
Relative URIs are resolved to full URIs using a base URI. As an example of relative URI resolution, assume we have the base URI "http://www.marcric.com/public/index.html". The relative URI in the following markup for a hypertext link:
Would expand to the full URI "http://www.marcric.com/public/html-course.html", while the relative URI in the following markup for an image
<IMG src="../icons/logo.gif" alt="logo">
Would expand to the full URI "http://www.marcric.com/icons/logo.gif".
In HTML, URIs are used to:
- Link to another document or resource.
- Link to an external style sheet or script.
- Include an image, object, or applet in a page.
- Create an image map.
- Submit a form.
- Create a frame document.
- Cite an external reference.
- Refer to meta-data conventions describing a document.
In Usability terms, try to keep your site URI as small and clean as possible.