HTML Chapter 3 Hyperlinks
HTML Chapter 3 Hyperlinks
Zahid Javed
HYPERLINKS
Definition:-
Each website on world wide web contain many pages
that are linked with one another. The links are used
to move from one location to another on internet. A
link may consist of simple text as well as an image.
The link is also known as hyperlink.
Link
HYPERLINKS
Types Of Hyperlinks:-
Hyperlinks can be of three kinds:
1- Page-jump: these are the hyperlinks that are linked with other
location within the same page. The location to which this hyper link
is linked is called Bookmark.
For example:
First you need to place a bookmark (named anchor) in your page
where you want the user to be able to jump to:
Link
<a href="#bookmark1">goto bookmark1</a>
HYPERLINKS
Types Of Hyperlinks:-
Hyperlinks can be of three kinds:
Example:-
<html>
<body>
<H4> Email Hyperlink</H4>
Click to send <a
href="mailto:zahidJaved_uaf@yahoo.com">email</a>
</body>
</html>
Link
CREATING HYPERLINKS
<A> (anchor) tag is used to create a hyperlink in a webpage. HREF
attribute of <A> tag specifies location to which the link is
connected. An anchor can be linked to the
following:
Another web page
Another part of the same web page
A file etc.
Attributes:-
LINK: It specifies the color of hyperlinks. It can be specified by
using color name or its hexadecimal code.
</body>
</html>
Link
<A TARGET="" > HTML ATTRIBUTE
Frames deprecated; only use _blank
The only currently relevant value of target is _blank. The other
values of target were used to specify specific frames. However,
frames have been deprecated in HTML5.
Link
HTML <A> DOWNLOAD ATTRIBUTE
Definition and Usage
The download attribute specifies that the target will be
downloaded when a user clicks on the hyperlink.
This attribute is only used if the href attribute is set.
The value of the attribute will be the name of the downloaded
file. There are no restrictions on allowed values, and the browser
will automatically detect the correct file extension and add it to
the file (.img, .pdf, .txt, .html, etc.).
Link
HTML <A> DOWNLOAD ATTRIBUTE
Link
LINK TO ANOTHER WEB PAGE
A hyperlink can refer to a web page in the same website. This
type of hyperlink is frequently used in almost all websites.
The visitors view different web page of a website by clicking
on different hyperlinks that refer to different pages.
Example:-
<A HREF=“contact.html”>Contact us</A>
<A HREF=“images/contact,html”Target=“_blank”>Contact us
</A>
The above example will open the contact.html page in a new
window.
IMAGES AS HYPERLINK
Example:-
<a href=http://www.itseries.com.pk><IMG
scr=“itmono.jpg”></a>
<html>
<body>
<h3> Click The Image to send an email </h3>
<p>
<A href="mailto:jawad_virgo1147@yahoo.com">
<img src="pic.jpg.jpg" alt="Send Email" width="153"
height="177" ></A>
</body>
</html>
Link
HYPERLINKS IN LISTS
The Hyperlinks can also be displayed in ordered and
unordered list
Example:-
<H3>Hyperlinks in a List</H3>
<ul>
<li>
<a href="http://www.hotmail.com">Hotmail</a>
<li>
<a href="http://www.yahoo.com">Yahoo</a>
<li>
<a href="http://www.facebook.com">Facebook</a>
</ul>
Link
HYPERLINKS IN A TABLE
The Hyperlinks can also be displayed in tables
Example:-
<h3>Hyperlinks in Table</h3>
<table border="1" width="25%">
<tr>
<td width="45%"><a href="http://www.hotmail.com">Hotmail</a></td>
<td width="55%"><a href="http://www.yahoo.com">Yahoo</a></td>
</tr>
<tr>
<td><a href="http://www.Facebook.com">Facebook</a></td>
<td><a href="http://www.Google.com.pk">Google</a></td>
</tr>
</table>
Link