<< .. Go to : : Home : : Exercise 4 : : Demo 4A : : Demo 4B : : Demo 4C : : Demo 4D : : Demo 4E : : TAGS : : All Class Demos .. >>

Exercise 4 Demo: Part B : Linking - Using the Anchor Tag

This is the HTML you will need for Part B of Exercise 4.

Using Images as Links (Hot Links)

Now that you understand how to use links - what if you want to use an image as a link? Simple! Create an image link by placing the opening anchor tag <a>, then an image tag <img src="image.type" /> and then closing the anchor tag </a>. Instead of underlined text, your image has a border of the link color. You click on the image to move to the linked document. Your code would look like this:
<a href="flower.html" target="_blank">
<img src="images/flowersm.jpg" alt="flower" border="3" height="72" width="90">
</a>


The link looks like this:

flower

Note the border attribute. With most links you get an underline. With a 'hot' image, you get a border. You can choose the width of this border by setting the value to a number in pixels. The default is "1". Turn the border off by putting border="0".


Email URLs

Create an email link so people can send you email right from your web page. The code could look like this:

<a href="mailto:you@your-email-address.com"> Send me some email </a>

Send me some email

For more about using Links go to Part C of Demo 4.

To go back to Part A of Demo 4.

Go back to the Exercise 4 page.

© Claudia Faulk. Created in 2008. Updated 1.15