Tutorials Bugs Masterclass Free stuff Test pages Proposals

Basic concepts

Advanced concepts

RichInStyle.com HTML 4 guide - Essential concepts - part 2

Contents

Search engine indexing of pages

Specifying the language of a page

Meta data

Specifying the beginning of a set of documents

LINK

Search engine indexing of pages

One of the most important factors in web page construction, but also one of the most frequently overlooked is that of how search engines will find them.

Specifying the language of a page

This should be done using the lang attribute on the HTML element. E.g., <HTML lang="en">. This will assist the user by ensuring that the document that they get is in their favored language.

Other codes include es (Spanish), fr (French) and de (German).

In addition, if the page has translations, you should link to these. This will allow search engines to find the page:

<HEAD>
<LINK rel="alternate" href="document.html" hreflang="es" lang="es" type="text/html">
</HEAD>

Meta data

Meta data is information about data - it can be used to describe the page so that the search engine can index it appropriately:

<META name="keywords" content="Pekinese,Siamese,cats">
<META name="description" content="A page about cats">

Meta data always goes in the HEAD:

<HEAD>
<META name="keywords" content="Pekinese,Siamese,cats">
<META name="description" content="A page about cats">
</HEAD>

The keywords are a comma-separated list of keywords that should trigger a 'hit' on your site. The description is just that - the description that the site will use to describe your page.

Specifying the beginning of a set of documents

In order that search engines can find the start page of a linked collection as well as the individual pages, you should use the LINK element:

<HEAD>
<LINK rel="start" type="text/html" href="main.html" title="A description of the link">
</HEAD>

LINK

The A element represents by far the most common sort of link - to change from one document to another. The LINK element on the other hand, allows more unusual relationships to be specified - we've already seen it be used to link style sheets (see the section on formatting), and there also other relationships that it can make.

The type of relationship is specified using the rel and rev attributes, and the location of the linked document with the href attribute. For example, <LINK rel="contents" href="contents.html">. Note that the LINK element differs from A in that LINK is not rendered and therefore it can only appear in the head.

Despite not being rendered, the LINK element performs several useful functions:

  1. providing alternate versions of documents
  2. providing information for search engines
  3. enabling browsers to use the LINKs for navigational purposes.

The two main attributes on LINK, rel and rev specify whether a relationship is forward or reverse respectively. E.g.:

d.html - <LINK rel="nada" href="e.html">

is the same as:

e.html - <LINK rev="nada" href="d.html">

Here's some examples of what can be done:

  1. <LINK rel="alternate" hreflang="es" href="spanish.html"> - specifies a Spanish translation
  2. <LINK rel="start" href="contents.html"> - specifies a starting page; useful for search engines
  3. <LINK rel="alternate" media="print" type="application/postscript" href="print.ps"> - specifies a version suited to printing

That's the end of this part of the HTML guide. The next section considers tables, so I suggest you click here to continue.