You are on page 1of 13

Links and Tables

Links in HTML
 A hyperlink (or link) is a word, group of words, or
image that you can click on to jump to a new
document or a new section within the current
document.
When you move the cursor over a link in a Web page,
the arrow will turn into a little hand.
Links have three parts
Destination
is the file to be opened,
Label
is the portion in the page the user selects, and
Target
is the location where the file opens.
Destination
Relative path
If a linked file or image is in the same folder as the
hypertext link then only the file name needs to be
specified.
Absolute path
indicate the names of the drive and/or the folders that
specify where the linked file is located.
Anchor Tag <a>
An anchor is a piece of text which marks the beginning
and/or the end of a hypertext link.
The <a> tag can be used in two ways:
To create a link to another document, by using the href
attribute
To create a bookmark inside a document, by using the
name attribute
Anchor Attributes
HREF (Hypertext REFerence)

<a href=“www.letran.edu”>My school</a>

<html>
<head><title>link</title></head>
<body>
this is a sample of a link

<a href="www.letran.edu">My school</a>

</body>
<html>
Anchor Attributes
Target
specifies where to open the linked document.

<a href=www.letran.edu target=“_blank”>My school</a>


Anchor Attributes
Name
specifies the name of an anchor.
the name attribute is used to create a bookmark inside an
HTML document.

<a href=“#top”>Go to top</a>


|
:
|
<a name=“top”>Welcome to My Home Page</a>
Anchor Attributes
mailto:

The mailto is a quick way to add the facility of receiving


feedback from visitor on your web site.
Creates a link which when clicked by the visitor it
launches their email program with a new email message
window. The visitor could then formulate the email
message and send it off to you.

Note: mailto assumes that the visitor has configured an


email client (say, Outlook Express) to send emails.
Syntax forms of a mailto:
Bare form
<a href=“mailto:jeng_ventus@yahoo.com”>E-mail
me</a>
Output: E-mail me

Complex form
<a href="mailto:jeng_ventus@yahoo.com?subject=Feedback
for Web development students&body=The Tips and Tricks
section is great">E-mail me</a>
Output: E-mail me
Using the bare form
of the mailto:

Using the complex


form of the mailto:

A
A Carbon
Carbon Copy
Copy (CC),
(CC), and
and aa Blind
Blind
Carbon Copy (BCC) may also be
included to the complex by adding
“&cc=”
“&cc=” or
or “&bcc=“
“&bcc=“ toto the
the code
code
<a href="mailto:jeng_ventus@yahoo.com?subject=Sample of
using mailto&body=Now i know&cc=ventusj@dls-
csb.edu.ph">E-mail me</a>
<a href="mailto:?subject=Check this out &check out this
link http:\\www.letran.edu"> Send this page to a
friend</a>

You might also like