HTML Links
HTML Links
DCIS1204
SEMISTER TWO
YEAR ONE
HTML LINKS
A link is a connection from one Web resource to another. Although a simple concept, the link has
been one of the primary forces driving the success of the Web.
A link has two ends -- called anchors -- and a direction. The link starts at the "source" anchor and
points to the "destination" anchor, which may be any Web resource (e.g., an image, a video clip, a
sound bite, a program, an HTML document, an element within an HTML document, etc.).
The default behavior associated with a link is the retrieval of another Web resource. This behavior
is commonly and implicitly obtained by selecting the link (e.g., by clicking, through keyboard
input, etc.).
Types of links
1. <a> Links(anchor links/tag)
Syntax
In HTML, links are defined with the <a> tag:
<a href="url">link text</a>
HTML LINKS
By default, a link will appear like this (in all browsers): unless you set the colors from the
default colors to yours.
An unvisited link is underlined and blue
A visited link is underlined and purple
An active link is underlined and red
HTML Links - The target Attribute
The target attribute specifies where to open the linked document. You may set the target
document to open from a new window or tab.
Example
<a href="http://www.mtac.com/" target="_blank">Visit MTAC</a>
The example above will open the linked document in a new browser window or in a new tab.
HTML LINKS
NOTE: There are a number of other common types you'll come across. For example, a link to the
site's favicon:
<link rel="icon" href="favicon.ico">