Search DaTutorials:  
HOME
Html Tutorials
Basics
Forms
Frames
Hyperlinks and URLS
Images
Lists
Background
Colors
Fonts
Tables
Meta Tags
Events
Javascript Integration
Sound
Other
Search For a Tutorial
Html Reference

Set an image as a link

Description:


How to create a link from an image.

Code:

<html>
<body>

Click on the image bellow to check if it is a link:<br />

<a href="http://www.google.com">
<img border="0" src="button.gif" width="50" height="30">
</a>

</body>
</html>

Play with the code:

See working example:


Explanation:

To set an image as a link in html page you have to surround the <img > tag with the <a > and </a > tags. It is the same as creating a text link, but replace the text with the <img > tag.

Note: If you don't specify the border property, then its default value will be used and it is 1. This way you'll have border around the image. To get rid of that border just set the border property value to 0 as it is in the example above.

See Also:

HTML: Html, Body, A, Img


Online Html Forum  Discuss this tutorial in our HTML forum


     Problem Mortgage | Personal Finance | Mortgages | Apply for Credit Card | Bleach
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp