HTML: Working with Special Characters - Linking to Someone Else’s Website
(Page 2 of 5 )
It is also possible to link to another person’s website using the <a href> tag. Here is how you do it:
<html>
<body>
<p>
<a href="http://www.google.com/">Google</a>
</p>
</body>
</html>
The above code creates a page with the word Google on it. The <a href> tag places the link to google.com into the word Google. When the user clicks the word, it loads the Google web page.
Inserting a Link Within An Image
You can also place a link within an image. This is useful for creating buttons that link to other pages on your website or banners that link to someone else’s site.
<html>
<body>
<p>
<a href="somepage.htm">
<img border="0" src="somegraphic.gif" width="75" height="40">
</a>
</p>
</body>
</html>
The code above creates a page with an image on it. It then places a link within the image that will load the somepage.htm page when the user clicks on it.
Next: Opening a Link In a New Window >>
More HTML Articles
More By James Payne