G.8. meta Elements

Search engines are used to find Web sites. They usually catalog sites by following links from page to page (known as spidering or crawling) and saving identification and classification information for each page. One way that search engines catalog pages is by reading the content in each page's meta elements, which specify information about a document.

Two important attributes of the meta element are name, which identifies the type of meta element, and content, which provides the information search engines use to catalog pages. Figure G.8 introduces the meta element.

Figure G.8. meta tags provide keywords and a description of a page.

1 6 7 8

"http://www.w3.org/1999/xhtml"> 9 10 Internet and WWW How to Program - Welcome 11 12 13 14 "keywords" content = "Web page, design, 15 XHTML, tutorial, personal, help, index, form, 16 contact, feedback, list, links, frame, deitel" /> 17 18 "description" content = "This Web site will 19 help you learn the basics of XHTML and Web page design 20 through the use of interactive examples and 21 instruction." /> 22 23 24 25 26 27

Welcome to Our Web Site!

28 29

We have designed this site to teach about the wonders 30 of XHTML. XHTML is 31 better equipped than HTML to represent complex 32 data on the Internet. XHTML takes advantage of 33 XML's strict syntax to ensure well-formedness. Soon you 34 will know about many of the great new features of 35 XHTML.

36 37

Have Fun With the Site!

38 39 40

Lines 1416 demonstrate a "keywords" meta element. The content attribute of such a meta element provides search engines with a list of words that describe a page. These words are compared with words in search requests. Thus, including meta elements and their content information can draw more viewers to your site.

Lines 1821 demonstrate a "description" meta element. The content attribute of such a meta element provides a three- to four-line description of a site, written in sentence form. Search engines also use this description to catalog your site and sometimes display this information as part of the search results.

Software Engineering Observation G 1

meta elements are not visible to users and must be placed inside the head section of your XHTML document. If meta elements are not placed in this section, they will not be read by search engines.

Категории