Section G.8. meta Elements


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  <?xml version = "1.0" ?>  2  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  3     "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  4  5  <!-- Fig. G.8: main.html -->  6  <!-- <meta> tag -->  7  8  <html xmlns = "http://www.w3.org/1999/xhtml">  9     <head> 10        <title>Internet and WWW How to Program - Welcome</title> 11 12        <!-- <meta> tags provide search engines with --> 13        <!-- information used to catalog a site            --> 14        <meta name = "keywords" content = "Web page, design, 15           XHTML, tutorial, personal, help, index, form,     16           contact, feedback, list, links, frame, deitel" /> 17 18        <meta name = "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     </head> 24 25     <body> 26 27        <h1>Welcome to Our Web Site!</h1> 28 29        <p>We have designed this site to teach about the wonders 30        of <strong><em>XHTML</em></strong>. <em>XHTML</em> is 31        better equipped than <em>HTML</em> to represent complex 32        data on the Internet. <em>XHTML</em> 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        <em>XHTML.</em></p> 36 37       <p>Have Fun With the Site!</p> 38 39     </body> 40  </html> 

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.




Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net