Click here to GET READY

PC Magazine

  PC Tech

Meta Tags Target Your Pages

Introduction

Metadata: History and Syntax

Beat the Search Engines

Manage Content

Resources



X10.com - The SuperSite for Home Automation!

Click Here!

 
  Categories
World Wide Web

Meta Tags Target Your Pages
Metadata: History and Syntax

Continued from Introduction

Using standard HTML tags, you can't provide background information about Web content, such as who created a particular page or when it was last modified. HTML is designed primarily to present information, not to record details. The <META> tag can hold this higher-level information on Web pages.

A key technology that comes into play whenever you use meta tags is HTTP. The HyperText Transfer Protocol specifies how information is transferred over the Web and used to request Web documents, and how to return responses. Responses are formatted with an HTTP header and body. The header contains information browsers need to interpret the document, such as its content type. The body contains the rest of the document's contents.

Normally, HTTP headers are set automatically by Web servers based on responses to requests for resources. But rather than having the Web server determine which headers are used, you can modify existing headers or create your own using the HTTP-EQUIV tag. This lets you customize browser and server behavior. For example, let's say the default content type and character set for the server are text/html and ISO-8859-1 (Western, Latin-1). The server sets this information in an HTTP header as

Content-Type: text/html; CHARSET=ISO-8859-1

With a meta tag, you can override the default content type, setting the default character set to ISO-8859-5 (Cyrillic) as follows:

<META HTTP-EQUIV="Content-Type"
CONTENT="text/html; CHARSET=ISO-8859-5">

Now instead of seeing the Latin-1 character set, readers see the Cyrillic character set, which works for the Russian translation of your favorite play. Usually, HTTP-EQUIV directives are passed directly to browsers for interpretation. Some Web servers translate the directives into actual HTTP headers automatically, however. If this happens, you may not be able to view the source of a Web page to see its meta tags. Content-Type is only one of many similar meta values. Here are a few more:

HTTP-EQUIV="Content-Disposition" 
     specifies an application handler for the file.
HTTP-EQUIV="Content-Script-Type" 
     sets the default scripting language.
HTTP-EQUIV="Content-Style-Type" 
     sets the default stylesheet language.
HTTP-EQUIV="Content-Language" 
     declares the natural language for the page.

Other meta tag definitions include information pertaining to the HTML version, browser version, Web authoring tools, and search engines. Most of these additional meta tag sources use the NAME attribute, which designates supplemental information that doesn't have a related HTTP header. In each of these tags, NAME identifies the value and CONTENT sets the actual value. The following example sets the author's name:

<META NAME="Author"
CONTENT="William R. Stanek">

Here are more meta values that use the NAME attribute to provide further information:

NAME="Copyright" 
     sets the copyright information.
NAME="Generator" 
sets the authoring tool that created the page.
NAME="Reply-To" 
     sets the contact e-mail address.

Some browsers and search engines may not be able to interpret your meta tags and will simply ignore them. Metainformation is always added to the page header inside the <head> and </head> tags, like this:

<html>
<head>
<META HTTP-EQUIV="Content-Type" 
     CONTENT="text/html; CHARSET=windows-1252">
<META HTTP-EQUIV="Content-Language" 
     CONTENT="en-us">
<META NAME="Generator" 
     CONTENT="FrontPage 4.0">
&l;ttitle>My Web Page</title>
</head>
<body>

...

</body>
</html>

New ways of thinking have evolved as a result of meta tags, bringing with them many new standards--standards that are predecessors to breakthrough technologies like RDF (Resource Description Framework), which provides a framework for describing various types of metadata. Learn more about RDF online at the World Wide Web Consortium's Web site (www.w3.org/rdf).

Next: Beat the Search Engines

Published as Internet Builder in the 7/1/99 issue of PC Magazine.

 
 Sponsored Links
Wanted  Better hours, more pay! Search here for your new job.
E*TRADE  Learn what Wall Street says about what's hot-FREE!
@Backup  @Backup Lite is absolutely Free. Install here
Very Cool  Wired Home Intro Kit - X10.com
Books  Great Books for $1, while supplies last!
Best PCs  Get a great PC for your money. 500 MHz, $1,699!
 ZDNet Featured Links
Freebies  50 FREE downloads - utilities, screen savers and more!
Bargains!  Shop the Basement for best buys on computer products
Contest!  Enter today to win a FREE digital camera from ZDNet!
 Magazine Offers
Software  Get a FREE CD-ROM from FamilyPC magazine

TOP
Copyright (c) 1999 Ziff-Davis Inc.