22.06.2015 Views

Step by Step HTML5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

20 Chapter 2<br />

Note Not all search engines refer to tags. Google does not, for example; it indexes<br />

only the text contained in the area. Because of the potential for abuse of the system,<br />

such as Web developers packing their pages with unrelated keywords, fewer and fewer search<br />

engines these days are using them.<br />

For example, suppose The Garden Company’s Web site would be useful to people who<br />

are searching for information about all types of gardening problems, such as pests,<br />

weeds, and fungus, and about growing flowers and vegetables. Perhaps all these topics<br />

are not mentioned on the main page, but you want people who search for those words<br />

to be directed to the main page anyway. You could place the following in the <br />

section:<br />

<br />

Notice that the tag in the above code is a single-sided tag that contains two<br />

attributes: name and content. The values for each of those arguments follow the equals<br />

sign and are contained in double quotation marks.<br />

Note If you are coding in XHTML, you would add a space and a slash (/) at the end of a<br />

tag because it is a one-sided (self-closing) tag. This is not necessary in HTML.<br />

The tag can also be used to redirect visitors to another page. For example, suppose<br />

you told everyone the address of your Web site, and then you needed to move it to<br />

another URL. You could place a “We’ve Moved” page at the original address and use the<br />

tag to redirect users to the new address after five seconds, like this:<br />

<br />

Here’s yet another common use: the tag can specify a character encoding<br />

scheme. This is not a big issue if you are coding only in English (or in a language like<br />

English that uses a Roman character set), but it is considered a tidy coding practice to<br />

include anyway. If you want, you can add to the section<br />

of your document to explicitly spell out that your page is in English.<br />

In this exercise, you will add a page title and some keywords to the index.htm page you<br />

created in the preceding exercise.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!