Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
You are here: Reference > HTML > tags > meta

meta element

Browser support:
Specifies general information about the document.
The meta element can be used to specify the character set and content-type of your page, keywords for search engines and other information about your document.
The meta element must be placed in the head section before the body element.
The next table contains only the most commonly used meta tags, for a complete list of available meta definitions, please see the page for the http-equiv or name attributes.
meta type Description
author Records the name of the author of the document.
<meta name="author" content="dottoro.com" />
cache-control Controls the caching mechanism to use for the page.
Available values:
Public - cached in public shared caches
Private - cached in private cache
no-Cache - not cached
no-Store - cached but not archived
<meta http-equiv="cache-control" content="NO-CACHE" />
charset Specifies the character set for the page content in HTML5. It is recommended to always specify the character set. In document types other than HTML5, use the 'content-type' meta tag instead. For a list of character sets, please see the page for the character sets.
<meta charset="UTF-8" />
content-language Specifies the primary natural language(s) of the document. Used by search engines to categorize pages by language.
<meta http-equiv="content-language" content="en-US,de" />
content-type Specifies the character set for the page content. It is recommended to always specify the character set. In HTML5, use the charset attribute instead. For a list of character sets, please see the page for the character sets.
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
copyright Used to include copyright information into the document.
<meta name="copyright" content="© 2009 Dottoro.com" />
date Specifies the date and time when the page was created.
<meta http-equiv="date" content="Thu, 18 Nov 2008 19:11:42 GMT" />
description Some search engines pick up this description to show with the results of searches.
<meta name="description" content="...Help page for the meta tag..." />
expires Specifies the date and time when the page will expire.
<meta http-equiv="expires" content="Wed, 9 Nov 2011 12:00:00 GMT" />
googlebot This is an addition to the robots META Command, it informs only the Google search engine about indexing, archiving and link following rules.
<meta name="googlebot" content="noarchive" />
keywords Inform search engines what your web site or page is about. It is recommended to always specify this type of meta, because it is necessary for search engines to catalogize the page.
<meta name="keywords" content="help, html help, JavaScript help, CSS help, manual ..." />
last-modified Specifies the last modification date.
<meta http-equiv="last-modified" content="Thu, 18 Nov 2008 19:11:42 GMT" />
refresh Indicates the document displays for a specified amount of time before switching to a new URL or refreshes the current. Useful to redirecting browsers to other pages, or to refresh the current page (news page).
<meta name="refresh" content="15" /> <meta name="refresh" content="15;URL=http://www.dottoro.com" />
robots Defines pages robot indexing mechanism, search engines indexing and link following rules.
The content attribute should have a comma separated list of the following values:
ALL - Robots should follow links, index and archive this page.
FOLLOW - Search engine robots should follow links from this page.
INDEX - Robots should include and index this page.
NOARCHIVE - Prevent search engines from archiving the page
NOINDEX - Robots should follow links, but should not index the page.
NOFOLLOW - The page can be indexed, but links should not be followed.
NONE - Search engine robots can ignore the page.
<meta name="robots" content="ALL" /> <meta name="robots" content="INDEX,NOFOLLOW" />
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: meta.

Possible members:

Attributes
Events
Styles
charset
Sets the character encoding of the document, a linked document or a script block.
content
Sets or returns the meta information itself.
dir
Sets the text direction as related to the lang attribute.
http-Equiv
Sets information for HTTP response message headers. Use it with the content attribute to create a well-defined meta tag.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
name
Sets the name given to the meta information. Use it with the content attribute attribute to create a well-defined meta tag.
scheme
Specifies how the value of content should be interpreted, when name is used.
xml:lang
Sets the language code of the XML document.

Example HTML code 1:

This example shows how to set the character encoding of the document in HTML5:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
</head>
<body>
</body>
</html>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to set the character encoding of the document in document types other than HTML5:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
</body>
</html>
Did you find this example helpful? yes no

Example HTML code 3:

This example illustrates the use of meta elements:
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="Expires" content="Tue, 20 Aug 2020 14:25:27 GMT" />
    <meta name="Author" content="Dave Raggett" />
</head>
<body>
</body>
</html>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content