0% found this document useful (0 votes)
19 views2 pages

HTML Links - by - JS Rao - Sir

hj

Uploaded by

dassbabu8799
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

HTML Links - by - JS Rao - Sir

hj

Uploaded by

dassbabu8799
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML LINKS Concept :

 Links are used to establish the linking between two web pages or two locations of same web page.
 HTML links are hyperlinks.
 We can click on a link and jump to another document.
 When we move the mouse over a link, the mouse arrow will turn into a little hand.
 Hyper links can be created using anchor tag. -------->> <a>
 Syntax : <a href = "destination_location_link" > Link text </a>
 Note: A link does not have to be text. A link can be an image or any other HTML element!

Example:
<a href="https://facebook.com/">Visit <b>Facebook Login </b> Page. </a>

 Here , The "href" attribute specifies the destination address (https://facebook.com/) of the link.
 The link text is the visible part (Visit Facebook Login Page.) on browser for clicking links.
 Clicking on the link text will send you to the specified destination address.

Linking can be done in following two ways. They are


1 ) Inter linking
2 ) Intra linking

1 ) Inter linking:
 When ever one web page is communicate with other web page is known as "inter
linking".
<a href ="web page location" target = "loading location"> Link name </a>

 By default, the linked page will be displayed in the current browser window.
 To change this, you must specify another target for the link.
 The target attribute specifies where to open the linked document.
 The target attribute can have one of the following values:
target = "_self" -->> Loads the current web page in the same window or frame.
target = "_blank" -->> Loads the current web page in a new window or new
frame.

Q ) Write a html program to achive inter linking ?


<html>
<head>
<title> Inter Linking </title>
</head>

<body>
<h1 align="center">
<a href="https://facebook.com/" target="_self">
1.Visit <b>Facebook Login </b> Page. </a> <br>
<a href="https://facebook.com/" target="_blank">
2. Visit <b>Facebook Login </b> Page. </a>
</h1>
</body>
</html>

2 ) Intra linking (B):


 When ever linking is done with in the same web page of between two locations is known as "intra linking".
<a href ="#location_name1" name="location_name2" > Link1 </a>

<a href ="#location_name2" name="location_name1" > Link2 </a>

 If you want to jump from one location to another location with in the Same page then we need to add Link1
href value as a name attrinute value in Link2 and Link1 name attribute value give as a href value in Link2.

Q ) Write a html program to achive the intra link concept ?

<html>
<head>
<title> Inter Linking </title>
</head>

<body>
<h1 align="center">
<a name="top" href="#bottom"> Bottom </a>
<!-- Here, we can write n number of html tags what we want to
display on our web page -->

<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br>

<a href="#top" name="bottom"> Top </a>


</h1>
</body>
</html>

You might also like