Tony Johnson 8/12/97 WSC meeting The Meta Tag Tony Johnson 8/12/97 WSC meeting
Meta Tag Definition Examples Use of http-equiv Use with Search Engines Other uses?
Meta Tag Definition (from W3C) The META element can be used to include name/value pairs describing properties of the document, such as author, expiry date, a list of key words etc. The NAME attribute specifies the property name while the CONTENT attribute specifies the property value, e.g. <META NAME="Author" CONTENT="Dave Raggett"> The HTTP-EQUIV attribute can be used in place of the NAME attribute and has a special significance when documents are retrieved via the Hypertext Transfer Protocol (HTTP). HTTP servers may use the property name specified by the HTTP-EQUIV attribute to create an RFC 822 style header in the HTTP response. This can't be used to set certain HTTP headers though, see the HTTP specification for details. <META HTTP-EQUIV="Expires" CONTENT="Tue, 20 Aug 1996 14:25:27 GMT"> will result in the HTTP header: Expires: Tue, 20 Aug 1996 14:25:27 GMT This can be used by caches to determine when to fetch a fresh copy of the associated document.
Meta Tag Example Typical HTML page generated by Frontpage <head> <meta http-equiv="Content-Type” content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Microsoft FrontPage 2.0"> <title>HEPVIS 98</title> <meta name="FORMATTER" content="Microsoft FrontPage 2.0"> </head> Net effect - zilch
Meta tag with http-equiv Any http tag can be specified using meta tag, but not many very useful. Don’t use in cgi scripts - specify http header directly. Preventing pages which may changed from being cached <meta http-equiv=“Expires” content=“Tue, 20 Aug 1996 14:25:27 GMT”> Redirection of obsolete HTML pages. <meta http-equiv="Refresh" content="2; url=new.html”> Use with frames: <META HTTP-EQUIV="Window-target" CONTENT="_top"> Beware: All uses non-standard and subject to browser/server capabilities.
Meta Tags with Search Engines Some search engines (Alta Vista, Infoseek, Harvest?) support the use of Meta tags: e.g. <META NAME="description" CONTENT="Demonstrations Of Advanced HTML"> <META NAME="keywords" CONTENT="HTML,Advanced,Search,Floating Frames"> <META NAME="robots" CONTENT=”noindex,nofollow”> Because these tags are non standard and widely abused some search engines ignore them totally, and others will ignore them if, for example, they contain many or repeated keywords.
References HTML 3.2 reference at w3c Advanced HTML http://www.w3.org/TR/REC-html32.html#meta Advanced HTML http://www.dananeda.demon.co.uk/html/advancedhtml.htm#Meta Info on META tag (detailed) http://vancouver-webpages.com/META/