Links are the most important part of the World Wide Web. The i...
strength of the World Wide Web lies in its ability to link several In this Chapt
Web pages together. Linking is a useful feature supported by HTML
that makes it possible to define hyperlinks to other Web pages Z
Containing information across the Internet and allows users to gain
Access tO any of the desired documents with just a click. Hyperlinks
or links, used interchangeably, stand for hypertext links. Simply
speaking, a hyperlink is a unidirectional pointer from the source
document that contains the link to some destination within the same Web page, a different Web
even a different Web site,
Behr
ers
Re
Linking is possible because every document on the Web has a unique address, known as the Uniform
Resource Locator (URL). Links are generally indicated by an underlined text and Appear in a different
Color, usually blue or purple, depending on whether the link Object has been visited or not. a link
includes an image, the border of the image will algo appear a blue or Purple, unless its attribute iss
to zero.
In the previous chapter, you had learnt how to create tables and insert images in an HTML doc
this chapter, you will learn about other important HTML elements like hyperlinks and fr
also learn to insert multimedia objects in a Web Page.
UNKING
Hyperlinks, or simply links, are the most important part of the Worl
Id Wide Web. Links tie Web pages
together in a Web site or across various Web sites,
A link or a hyperlink is a word, a group of words, or an image that is us
in the same Web site or another. When you move the mouse
changes its shape from an arrow to a small hand,
ed to jump to another docu
Pointer over a link, the mouse poite!
There are three different kinds of links:
* Internal A link to a different section of the Current document
Local A link to another page on the same Web site
* Global A link toa page on a different Web site
Creating Links
Welcome!
Click here to go back to the previous page.
When you click on the firs link on the Web page firstpage.html, the Web page nextpage. html, whic,
is on the same Web site will be displayed [Fig, 10.1(b)]. On clicking the second link, the page
www.oup.com will be displayed [Fig. 10.1(c)].
Welcome!
(Click here to 20 back tothe previous pase
Fig, 10.1(b) nextpage.htm|
Top Tip
1. Ifyouare linking toa page on the Web, the complete addres is required.
CBSE
2 Hfyou re linking oa page inthe sme director asthe current page, you jut need the page name.
MySchoolyou may ‘want to provide an
n of the page. This can be
e to where the link is to be
tribute. An anchor 0" #Unk Targets — The target attribute
PY default, links open in the current window. Ifyou want the link to open in ant
——
‘add a target. The target attribute specifies where to open the linked document, Ne Windy, ung
For example:
S Rref= “http: //wew.cbse.nic.in” target = “_blank”>CBSE
This will open the linked page in a new browser window or a new tab.
Other values that can be assigned to the target attribute are given in Table 10.1,
Table 10.1 Values of target attribute
Value Description a3
_=blank | Opens the linked document in a new browser window or a news fab
Opens the linked document in the parent frame
par
Opens the linked document in the same frame
elf
_=f0P _| Opens the linked document in full browser window
Defining Colors for tinks
Nou can use CSS to change the appearance and behaviour of hyperlinks. But first, let us leatn ab
kinds of links and their behaviour.
* link (Standard Link) This specifies a link that has not been visited yet. The default color of this link
is blue.
* visited (Visited Link) This specifies a link that the visitor has visited. Its default color is purple
* active (Active Link) This refers to the link that is clicked. The default color of this link is rec
Dut thal
* hover A link that appears when the user moves the mouse over it
Note: a:hover must come after a:link and a:visited, and a:active must come after a:hover.
Now consider this section of code for changing the link colors: