HTML: Links (Part 2)

 

Links

It can be useful to have a link that, when clicked, starts the process of sending an e-mail. This is called an e-mail link. As an example, an e-mail link that would send e-mail to the President of the U.S. might look like this:

Click on the link to write the President at<A HREF="mailto: president@whitehouse.gov"> president@whitehouse.gov</a> about this important issue.

What is different in an e-mail link from what we've seen before is the "mailto: " construct.

Here is how the e-mail link to the President looks on this page:

Click on the link to write the President at president@whitehouse.gov about this important issue.

 

Links and Images

There may be a time when it is appropriate to have an image behave as a link. If a viewer clicks on the image, she links to the destination defined in the link. Assume, for example, that you want to add a link to the U.S. Postal Service. You need to acquire an appropriate image; here's one:

Place the image inside an <A HREF> tag:

<A HREF="http://new.usps.com"><img src="USPS.jpg"></a><br>Click on the image to visit the U.S. Postal Service site.

Here's how this code shows up on the page:


Click on the image to visit the U.S. Postal Service site.

 

 As an alternative, both the image and the text could function as links to direct the viewer to the U.S. Postal Service site:

<a href="http://new.usps.com"><img src="USPS.jpg" border="0"><br>Click on the image or here to visit the U.S. Postal Service site.</a>

Here's how this code shows up on the page:


Click on the image or here to visit the U.S. Postal Service site.

 

Other Resources

Try these sites on using links:

Page Link
Primer #4 www.htmlgoodies.com/primers/html/article.php/3478171
<A> tag www.htmlhelp.com/reference/html40/special/a.html

or check out one of our reference books, or look for other help on the Web.

 

Exercise

You can either 1) work on your web page, or 2) work on the eEverything.com site. Add an e-mail link. Also, add an image that functions as some kind of link.

If you work on eEverything.com, the e-mail link might be to "webmaster@eEverything.com." The image that functions as a link might be of a product to be sold on eEverything.com, and clicking on the link would take the viewer to a page with more information on the product.