Difference between revisions of "Hyperlink"
(→On the web) |
(→On the web) |
||
Line 4: | Line 4: | ||
==On the web== | ==On the web== | ||
− | There are | + | To make a hyperlink in HTML, use the [[anchor tag]]: <code><a href="[[URL]]" title="Description of link">link text</a></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 <a href="http://shiftingpixel.com" title="Joe Lencioni's shifting pixel">best blog ever</a>.</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 | + | ====Relative from the web root==== |
{{section-stub}} | {{section-stub}} | ||
===Inline links=== | ===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: <code><a name="anchor-name"></a></code>. | ||
+ | |||
+ | {| class="round" cellpadding="2" cellspacing="0" | ||
+ | |+ Examples | ||
+ | |- class="odd" | ||
+ | ! URL | ||
+ | | #chapter-three | ||
+ | |- class="even" | ||
+ | ! HTML | ||
+ | |<nowiki>The <a href="#chapter-three" title="Jump to the third chapter">third chapter</a> 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.
Contents
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.
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>
.
URL | #chapter-three |
---|---|
HTML | The <a href="#chapter-three" title="Jump to the third chapter">third chapter</a> of this book. |