How To Use Links Properly

26 June 2007

How To Use Links Properly

The World Wide Web as we know it owes a great deal of its success to the humble hyperlink. Hyperlinks, which are usually referred to simply as links, are everywhere on the web. Without them - well, we'd have to call it the 'World Wide Repository of Random, Unsorted and Unclassified Documents'.

How To Use Links Properly

What is a URL?

Before we examine links, it is important to first understand URLs. A URL, or Uniform Resource Locator, is an address which identifies a resource on the Internet. To locate resources, you need the following information:

  1. Protocol (e.g http) - how to fetch the resource
  2. Username & password (e.g. sunburnt:passwd) - optional information for authentication
  3. Host (e.g. www.example.com) - the name of the computer where the resource resides
  4. Port (e.g. 80) - optional information about how the access the resource
  5. Path (e.g /images/logo.jpg) - the location of the resource on the host
  6. Query (e.g ?search=red+cars) - more optional information used to fetch the resource

Put them all together and you get a URL in the following format:

protocol://username:password@host:port/path?query

Most people would be familiar with URLs for web documents which are actually created using the generic pattern described above. For example:

http://www.example.com/images/logo.jpg

Absolute vs Relative URLs

The above examples describe absolute URLs. An absolute URL always begins with a protocol (e.g. http://). A relative URL is any URL which is not absolute. They can only be used in contexts where they can be resolved.

For example, if I have a document at http://www.example.com/products/jelly, I can create a link in this document using the relative URL /articles/recipes which will be resolved to http://www.example.com/articles/recipes.

Types of Links

Links enable us to conveniently refer users to other resources. Different terminology has been adopted to distinguish between the types of resources linked to:

  • Internal links direct the user to other pages on the same site.
  • External links direct the user to a different site.
  • Anchor links direct the user to a specific section of a page.
  • Backlinks are links to your site, from other sites.
  • Email links prompt the user to write an email to a specified recipient.
  • Javascript links cause some script to be executed in the browser (for example, to open a popup window)

Tips for Utilizing Hyperlinks

  • Don't CLICK HERE. Not only does this look terrible when overused (see below), but it tells search engines nothing about the content on your website - unless you are targeting the terms click and here! If you must use the words 'click here' in your link, use it as the start of a verb phrase.

  • Use verb or noun phrases for links. A descriptive phrase is far more likely to encourage users to traverse your links. Use verb phrases for call-to-action links ('Contact us today for a free quote'), and noun phrases in elsewhere, including titles ('Rain continues as big chill looms') and mid-paragraph.
  • Make links readable when printed. If you've created your links according to the two guidelines above, you should be able to read a printed version of your document naturally.
  • Send external links to a new window. By setting the target of external links to _blank, the page will open in a new window or tab. This will make it easier for visitors to return to your site after they have viewed the content at the external site.
  • Use absolute URLs in email. Email clients can't always be relied on to know where a document comes from, so a relative URL like "/home/about" may not be resolvable. It is better to always use absolute URLs when sending documents by email.

 

Leave a Comment

Please visit https://sunburnt.com.au/how-to-use-links-properly to add your comments.

Comment posted by: pinsssddi, 12 years ago