HTML 5 <meta> Tag
Example
Describe metadata:
<head>
<meta name="description" content="Free Web tutorials" />
<meta name="keywords" content="HTML,CSS,XML,JavaScript" />
<meta name="author" content="Ståle Refsnes" />
<meta charset="ISO-8859-1" />
</head> |
View it » |
Definition and Usage
The <menu> tag defines a menu list. Use this when you wish to list form
controls.
Definition and Usage
The <meta> element provides meta-information about your page, such as
descriptions and keywords for search engines and refresh rates.
Differences Between HTML 4.01 and HTML 5
The scheme attribute is not supported in HTML 5.
HTML 5 has a new attribute, charset, which makes it easier to define charset.
Example, define charset:
HTML 4.01:
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
HTML 5:
<meta charset="ISO-8859-1">
Tips and Notes
Note: The <meta> tag always goes inside the head
element.
Note: Metadata is always passed as name/value pairs.
Note: One, and not more, of these attributes must be defined: charset,
http-equiv, name.
Note: The content attribute MUST be defined if the name or the
http-equiv attribute is defined. if none of these are defined, the content
attribute CANNOT be defined.
Examples
Define keywords for search engines:
<meta name="keywords" content="HTML, CSS, XML,
XHTML, JavaScript" /> |
Define a description of your web page:
<meta name="description" content="Free Web tutorials
on HTML and CSS" /> |
Define the last revision of your page:
<meta name="revised" content="Ståle Refsnes,
19/10/2009" /> |
Refresh page every 5 seconds:
<meta http-equiv="refresh" content="5" /> |
Attributes
New : New in HTML 5.
Attribute |
Value |
Description |
charsetNew |
character encoding |
Defines the character encoding for the document |
content |
some_text |
Defines meta information to be associated with http-equiv or name |
http-equiv |
content-type
expires
refresh
set-cookie |
Connects the content attribute to an HTTP header |
name |
author
description
keywords
generator
revised
others |
Connects the content attribute to a name |
scheme |
format/URI |
Not supported in HTML 5 |
Standard Attributes
The <a> tag also supports the Standard Attributes in HTML 5.
|