HTMLforall

  HTML | PHP | Forum

HTML <meta> tag

Syntax

<meta> 

Contained in <head>

Definition and Usage

The META element provides metadata such as a document's keywords, description, and author. Any number of META elements may be contained in the <head> of a document.

META's NAME attribute provides a property name while the CONTENT attribute gives the corresponding value. The CONTENT attribute value may contain text and entities, but it may not contain HTML tags.

The optional SCHEME attribute gives the format of the property value. For example, a date property may require SCHEME="Month-Day-Year" to disambiguate the date from other formats such as SCHEME="Day-Month-Year".

There is no standard list of META properties, so authors may define whatever metadata they like.

Some search engines use keywords and description properties, giving extra weight to a document's keywords and providing its description with the link to the document.

To avoid being truncated by search engines, the description should be brief--no more than 200 characters. Keywords are separated by commas and may be considered case sensitive by search engines.

Required Attributes

Attribute Value Description
content text Defines meta information to be associated with http-equiv or name

Optional Attributes

Attribute Value Description
http-equiv content-type
expires
refresh
set-cookie
Connects the content attribute to an HTTP header
name author
description
keywords
others
Connects the content attribute to a name
scheme text Defines a format to be used to interpret the value of the content attribute (like a date)

Standard Attributes

dir, lang, xml:lang

For a full description, go to Standard Attributes.

Example

Source Output
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>HTML reference guide</title>
<meta name="description" content="Complete HTML reference guide." >
<meta name="keywords" content="html,guide,reference,tags">
<meta name="author" content="sunilcare">
<meta name="reply-to" content="webmaster@sunilcare.com">
<META NAME="robots" CONTENT="index,follow,all">
<META NAME="REVISIT-AFTER" CONTENT="7 days">
<LINK REL="stylesheet" HREF="/mystyle.css">

</head>
 

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

<!--...-->
<!DOCTYPE> 
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<b>
<base>
<basefont>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<dd>
<del>
<dfn>
<dir>
<div>
<dl>
<dt>
<em>
<fieldset>
<font>
<form>
<frame>
<frameset>
<h1> to <h6>
<head>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<isindex>
<kbd>
<label>
<legend>
<li>
<link>
<map>
<menu>
<meta>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<p>
<param>
<pre>
<q>
<s>
<samp>
<script>
<select>
<small>
<span>
<strike>
<strong>
<style>
<sub>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<title>
<tr>
<tt>
<u>
<ul>
<var>

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us