Building BobSmithPhotography.net has stopped expanding because I've been overwhelmed with spam on the comment forums. So, if you're here and have questions about web design come and visit Forums, Blogs, Wikis dot com. It has articles that I've written, some of which are also here, and a web design forum as well so you can ask any questions you may have. There is still a lot of good stuff here though, so poke around the links and take a look.

Home » HTML Tags » a

Anchor Tags

Anchor tags allow you to create links, either to an external document or within the same document.  Since the web is, well, a web of documents it is important that pages link to other pages, making the anchor tags very important to use in your web designing. 

An anchor begins with <a> and ends with </a>.  Between the two will be linked.  The link itself is determined using the href attribute inside the opening tag.

As a simple example, if you wanted to create a link to ProPhotoForum with the text 'ProPhotoForum' being the link you'd use the following code.

<a href="http://www.prophotoforum.com">ProPhotoForum</a>

This would look like this: ProPhotoForum

Notice that the href is equal to whatever web site you'd like to link to.  If you're linking within your own site you can leave off the domain.  So, to link to my glossary I can use the following code.

<a href="/glossary">Glossary</a>

This would create a link like Glossary

Images
You can also include an image inside the link.  Let's say I want to create an image link to the Etomite home page.  I would use the following code.

<a href="http://www.etomite.org"><img src="/etomitelogo.jpg"></a>

This would create the following link:
Etomite CMS Logo

Titles
One important addition is the title property.  Most browsers will show the title as a tool tip when a visitor hovers over the link.  Take the following example.

<a href="http://www.google.com" title="Google Search Engine">Google</a>

With that code you'll see Google.  Notice if you hover your mouse over the link you should see a tool tip 'Google Search Engine'. 

Frames & target
Never having been a fan of frames, I rarely use the target property.  But there is one useful trick here.  If you use 'target="_blank"' it will cause the link to open in a new window.

Content managed by the Etomite Content Management System.