- HTML Tutorial
- HTML - Home
- HTML - Introduction
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Headings
- HTML - Paragraphs
- HTML - Fonts
- HTML - Blocks
- HTML - Style Sheet
- HTML - Formatting
- HTML - Quotations
- HTML - Comments
- HTML - Colors
- HTML - Images
- HTML - Image Map
- HTML - Iframes
- HTML - Phrase Elements
- HTML - Meta Tags
- HTML - Classes
- HTML - IDs
- HTML - Backgrounds
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML Color Names & Values
- HTML - Color Names
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Picker
- HTML References
- HTML - Cheat Sheet
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <meta> Tag
HTML <meta> tag is used to provide such additional information. This tag is an empty element and does not have a closing tag but it carries information within its attributes.
HTML lets you specify metadata an additional important information about a document in a variety of ways. The META elements can be used to include name/value pairs describing properties of the HTML document, such as author, expiry date, a list of keywords, document author etc.
You can include one or more meta tags in your document based on what information you want to keep in your document but in general, meta tags do not impact physical appearance of the document so from appearance point of view, it does not matter if you include them or not.
Syntax
<meta attribute-name="value">
Attribute
HTML meta tag supports Global and accepts some specific attributes as well which is listed below.
Attribute | Value | Description |
---|---|---|
name | application-name author description generator keywords viewport |
Name for the property. Can be anything. Examples include, keywords, description, author, revised, generator etc. |
content | text | Specifies the property's value. |
charset | character_set | Specifies character encoding to for HTML document. |
http-equiv | content-security-policy content-type default-style refresh |
Used for http response message headers. For example, http-equiv can be used to refresh the page or to set a cookie. |
Examples of HTML meta Tag
Bellow examples will illustrate the usage of meta tag. Where, when and how to use meta tag.
Defining Metadata
Following is an example, where we are adding Meta Tag, metadata as important keywords about the document.
<!DOCTYPE html> <html> <head> <title>Meta Tags Example</title> <meta name="keywords" content="HTML, Meta Tags, Metadata" /> </head> <body> <p>Hello HTML5!</p> </body> </html>
Specifying Meta DEscription through meta Tag
In the following example we are going to use the <meta> tag to give a short description of the document. This can again be used by various search engines while indexing your webpage for search purposes.
<!DOCTYPE html> <html> <head> <title>Meta Tags Example</title> <meta name="keywords" content="HTML, Meta Tags, Metadata" /> <meta name="description" content="Learning about Meta Tags." /> </head> <body> <p>WELCOME TO TP</p> </body> </html>
Adding informative Metadata
Let’s consider the following example, where we are going to use the <meta> tag to give information about when the document was last updated. This information can be used by various web browsers while refreshing your webpage.
<!DOCTYPE html> <html> <head> <title>Meta Tags Example</title> <meta name="keywords" content="HTML, Meta Tags, Metadata" /> <meta name="description" content="Learning about Meta Tags." /> <meta name="revised" content="Tutorialspoint, 3/7/2014" /> </head> <body> <p>Hello</p> </body> </html>
Refreshing HTML page after Certain Time
Let’s look at the following example, where we are going to keep refreshing the page every 5 seconds.
<!DOCTYPE html> <html> <head> <title>Meta Tags Example</title> <meta name="keywords" content="HTML, Meta Tags, Metadata" /> <meta name="description" content="Learning about Meta Tags." /> <meta name="revised" content="Tutorialspoint, 3/7/2014" /> <meta http-equiv="refresh" content="5" /> </head> <body> <p>Hello World</p> </body> </html>
Supported Browsers
Tag | |||||
---|---|---|---|---|---|
meta | Yes | Yes | Yes | Yes | Yes |