Meta Elements

meta elements can be added to the head section of any HTML document . They do not add any content to the document and have no effect on its rendering. They are primarily used by search engines as additional information about a given HTML document. The effect a given meta will have on a search engine varies vastly and even simply taking the content of the meta element into consideration is completely up to the search engine itself.

Even though the effects of a meta element are not 100% guaranteed it is still not a bad idea to use them in your HTML documents.

A meta element must have the content attribute. A meta element may have a name or an http-equiv attribute.

Some of the more common names used with a meta element are description, keywords and author. These may or may not be used by search engines.

<meta name="description" content="A brief description of the document." />
<meta name="keywords" content="keyword1,another,and a third" />
<meta name="author" content="Me Myself" />

meta elements with the http-equiv attribute have a somewhat different purpose. They are used by the server and specify HTTP headers which need to be send to the client before the document itself.

Some of the common values of http-equiv are content-type, content-style-type, expires, refresh and set-cookie. The content-type meta specifies the type of the document to follow and is the most used. Here is an example of what it may look like:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />