GDT 150 Design for the Internet: Fall 2002
September 18
Types of Links
- Absolute
- Relative
- Root-relative
- Internal
Absolute
Gives the full web address of the linked document, including the transfer protocol.
Example: <a href="http://www.google.com">
Relative
Gives the URL relative to the current document. Assumes linked document is on the same server as linking document.
Example 1: a link to a document in the same folder: <a href="page.html">
Example 2: a link to a document in a folder within the current folder: <a href="documents/page.html">
Example 3: a link to a document in the folder containing the current document's folder: <a href="../page.html">
Root-relative
Links that use the site root (domain name) as a starting point. All the folder information is stripped off the URL. Root-relative links start with a slash.
Example: to link to www.chriscassell.net/classes.html from this page, <a href="/classes.html">
Never use this type of link on the student server because the root of the site is stu.wccnet.org, not your home directory.
Internal
Link to a point within a page. Internal links require 2 parts: the link itself, and the named anchor that the link points to. Can point to either the current document, or a point in another document.
Example 1: to link to a specific paragraph on the current page: <a href="#anchorname"> points to an anchor with a name: <a name="anchorname">
Example 2: to link to a specific paragraph on a different page: <a href="page.html#anchorname"> points to an anchor on page.html with a name: <a name="anchorname">
Email Link
Spawns the default email client
Example: to send an email to me: <a href="mailto:who@where.com">