Basic Structure

HTML <meta> Tag

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.

Definition and Usage

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.

Standard Syntax:<meta>

Interactive ExampleRunnable

HTML <meta> Example

html
Try it Yourself
Live code demonstration for the <meta> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<head>

  
 <meta charset="UTF-8">

  
 <meta name="description" content="Free Web tutorials">

  
 <meta name="keywords" content="HTML, CSS, JavaScript">

  
 <meta name="author" content="John Doe">
  <meta 
    name="viewport" content="width=device-width, initial-scale=1.0">

 </head>
</div>

Attributes for <meta>

4 Supported Attributes
AttributeValuesDefaultDescription
charsetcharacter_setnoneSpecifies the character encoding for the HTML document
contenttextnoneSpecifies the value associated with the http-equiv or name attribute
http-equivcontent-security-policycontent-type default-stylerefreshnoneProvides an HTTP header for the information/value of the content attribute
nameapplication-name author description generator keywordsviewportnoneSpecifies a name for the metadata
Global Attributes

The <meta> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <meta> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Basic Structure

View All 123Tags →