Hyperlinks
in HTML
Hyperlinks
• A hyperlink is a reference (an address)
to a resource on the web.
• Hyperlinks can point to any resource
on the web: an HTML page, an image,
a sound file, a movie, etc.
• The HTML anchor element <A>, is
used to define both hyperlinks and
anchors.
Hyperlinks
• Browser distinguishes hyperlinks
from normal text.
• Appears blue in color
• Default color setting
• Can be changed dynamically
• Hyperlink text is underlined
• When the mouse cursor is placed
over it, it will change to hand.
Hyperlinks
• Hyperlinking is done by using <A></A> anchor
tag. Syntax: <a href="url">Link text</a>
• The text between opening and closing <A> tag
act as a start/destination of a link.
• HREF attribute specifies URL of the destination
document/webpage/image.
Hyperlinks
• Link to a page on world wide web
<a href="http://www.globalinfochannel/">
Visit globalinfochannel!</a>
Result of Hyperlink Code
Hyperlinks
Link to an image by image as a link
<a href=“image2.jpg">
<img src =“image1.jpg”></a>
Hyperlinks
Link to document located to different directory
<a href=“d:activeabc.html”>
Click here</a>
Hyperlinks
Link to same page
<A HREF =“#samepage”>This is link</A>
.
.
.
.
<A NAME=“samepage”>You are in same
page</A>
Hyperlinks
Link to different sections of different documents:
File A.html:
<A HREF =“fileB.html #difflink”>This is link</A>
File B.html:
<A NAME=“difflink”>You are on different
page</A>
Hyperlinks
Link to mail:
<A HREF =“mailto:emailid@host”>Mail
me</A>
Ex:<A HREF =“mailto:abc@gmail.com”>Mail
me</A>

Hyperlinks in HTML

  • 1.
  • 2.
    Hyperlinks • A hyperlinkis a reference (an address) to a resource on the web. • Hyperlinks can point to any resource on the web: an HTML page, an image, a sound file, a movie, etc. • The HTML anchor element <A>, is used to define both hyperlinks and anchors.
  • 3.
    Hyperlinks • Browser distinguisheshyperlinks from normal text. • Appears blue in color • Default color setting • Can be changed dynamically • Hyperlink text is underlined • When the mouse cursor is placed over it, it will change to hand.
  • 4.
    Hyperlinks • Hyperlinking isdone by using <A></A> anchor tag. Syntax: <a href="url">Link text</a> • The text between opening and closing <A> tag act as a start/destination of a link. • HREF attribute specifies URL of the destination document/webpage/image.
  • 5.
    Hyperlinks • Link toa page on world wide web <a href="http://www.globalinfochannel/"> Visit globalinfochannel!</a>
  • 6.
  • 7.
    Hyperlinks Link to animage by image as a link <a href=“image2.jpg"> <img src =“image1.jpg”></a>
  • 8.
    Hyperlinks Link to documentlocated to different directory <a href=“d:activeabc.html”> Click here</a>
  • 9.
    Hyperlinks Link to samepage <A HREF =“#samepage”>This is link</A> . . . . <A NAME=“samepage”>You are in same page</A>
  • 10.
    Hyperlinks Link to differentsections of different documents: File A.html: <A HREF =“fileB.html #difflink”>This is link</A> File B.html: <A NAME=“difflink”>You are on different page</A>
  • 11.
    Hyperlinks Link to mail: <AHREF =“mailto:emailid@host”>Mail me</A> Ex:<A HREF =“mailto:[email protected]”>Mail me</A>