Metadata - Data about data
Meta data is the data about another data.
<meta>
tag is usually used to specify character set, keywords, author of the document, page descriptions, and viewport settings.
<meta>
tag can be used multiple times, and must be inside <head>
tag.
The information in <meta>
tag are used by browsers, search engine, or other web services.
Metadata is not displayed on the page.
Element Attributes
Attribute | Value | Description |
---|---|---|
charset |
character_set | This specifies character encoding in which the document is encoded. |
content |
text | This attribute contains the value of the http-equiv or name attribute, depending on which one is used. |
http-equiv |
content-security-policy&tab; content-type default-style refresh |
Provides an HTTP header for the data / value of the content attribute. |
name |
application-name author description generator keywords viewport |
This attribute specifies the metadata name. |
Global attributes
Global attributes may be applied on all elements, although some elements may have no effect on them.
<accesskey>
,
<class>
,
<contenteditable>
,
<contextmenu>
,
<data-*>
,
<dir>
,
<draggable>
,
<dropzone>
,
<hidden>
,
<id>
,
<lang>
,
<spellcheck>
,
<style>
,
<tabindex>
,
<title>
,
<translate>
.
Learning with HTML Editor "Try it Now"
You can edit the HTML code and view the result using online editor.
Example
<!DOCTYPE html>
<html>
<!-- Example: Meta Tag -->
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="w3context Team">
<meta name="description" content="Online tutorials">
</head>
<body>
<h1>Example meta tag.</h1>
<h2>The meta information are used by browsers, search engine, or other web services.</h2>
<p>Metadata is not displayed on the page.</p>
</body>
</html>
Click on the "Try it Now" button to see how it works.