Difference between revisions of "Hyperlink"

(On the web)
(On the web)
Line 4: Line 4:
  
 
==On the web==
 
==On the web==
There are two different types of hyperlinks on the web, absolute, relative, and inline links.
+
To make a hyperlink in HTML, use the [[anchor tag]]: <code>&lt;a href="[[URL]]" title="Description of link"&gt;link text&lt;/a&gt;</code>.
 +
 
 +
There are three different types of hyperlinks on the web, absolute, relative, and inline links.
  
 
===Absolute links===
 
===Absolute links===
 +
Absolute links are generally used to link to a document on a separate [[Website]] and are represented as a complete URL.
 +
 +
{| class="round" cellpadding="2" cellspacing="0"
 +
|+ Examples
 +
|- class="odd"
 +
! URL
 +
| http://shiftingpixel.com
 +
|- class="even"
 +
! HTML
 +
|<nowiki>The &lt;a href="http://shiftingpixel.com" title="Joe Lencioni's shifting pixel"&gt;best blog ever&lt;/a&gt;.</nowiki>
 +
|}
 +
 +
===Relative links===
 +
Relative links are used to link to a document that is located under the same [[domain name]] and are represented as a partial URL. There are two different types of relative links: relative from the current document and relative from the [[web root]].
 +
 +
====Relative from the current document====
 
{{section-stub}}
 
{{section-stub}}
  
===Relative links===
+
====Relative from the web root====
 
{{section-stub}}
 
{{section-stub}}
  
 
===Inline links===
 
===Inline links===
{{section-stub}}
+
Inline links are used to link to information within the same document and are represented by a pound sign (#) followed by the target anchor's name.
 +
 
 +
In order for an inline link to work, you need to give it a target to point to using the anchor tag: <code>&lt;a name="anchor-name"&gt;&lt;/a&gt;</code>.
 +
 
 +
{| class="round" cellpadding="2" cellspacing="0"
 +
|+ Examples
 +
|- class="odd"
 +
! URL
 +
| #chapter-three
 +
|- class="even"
 +
! HTML
 +
|<nowiki>The &lt;a href="#chapter-three" title="Jump to the third chapter"&gt;third chapter&lt;/a&gt; of this book.</nowiki>
 +
|}
  
 
{{stub}}
 
{{stub}}

Revision as of 13:12, 13 September 2006

A hyperlink (often referred to as simply a link), is a reference or navigation element in a document to another section of the same document, another document, or a specified section of another document, that automatically brings the referred information to the user when the navigation element is selected by the user.

Hyperlinks are part of the foundation for the World Wide Web but are not limited to HTML or the web. Hyperlinks may be used in almost any electronic media.

On the web

To make a hyperlink in HTML, use the anchor tag: <a href="URL" title="Description of link">link text</a>.

There are three different types of hyperlinks on the web, absolute, relative, and inline links.

Absolute links

Absolute links are generally used to link to a document on a separate Website and are represented as a complete URL.

Examples
URL
HTML The <a href="none" title="Joe Lencioni's shifting pixel">best blog ever</a>.

Relative links

Relative links are used to link to a document that is located under the same domain name and are represented as a partial URL. There are two different types of relative links: relative from the current document and relative from the web root.

Relative from the current document

Relative from the web root

Inline links

Inline links are used to link to information within the same document and are represented by a pound sign (#) followed by the target anchor's name.

In order for an inline link to work, you need to give it a target to point to using the anchor tag: <a name="anchor-name"></a>.

Examples
URL #chapter-three
HTML The <a href="#chapter-three" title="Jump to the third chapter">third chapter</a> of this book.