<meta>: The metadata element - HTML: HyperText Markup Language | MDN (2024)

The <meta> HTML element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <title>.

The type of metadata provided by the <meta> element can be one of the following:

  • If the name attribute is set, the <meta> element provides document-level metadata, applying to the whole page.
  • If the http-equiv attribute is set, the <meta> element is a pragma directive, providing information equivalent to what can be given by a similarly-named HTTP header.
  • If the charset attribute is set, the <meta> element is a charset declaration, giving the character encoding in which the document is encoded.
  • If the itemprop attribute is set, the <meta> element provides user-defined metadata.

Attributes

This element includes the global attributes.

Note: the attribute name has a specific meaning for the <meta> element, and the itemprop attribute must not be set on the same <meta> element that has any existing name, http-equiv or charset attributes.

charset

This attribute declares the document's character encoding. If the attribute is present, its value must be an ASCII case-insensitive match for the string "utf-8", because UTF-8 is the only valid encoding for HTML5 documents. <meta> elements which declare a character encoding must be located entirely within the first 1024 bytes of the document.

content

This attribute contains the value for the http-equiv or name attribute, depending on which is used.

http-equiv

Defines a pragma directive. The attribute is named http-equiv(alent) because all the allowed values are names of particular HTTP headers:

  • content-security-policy Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks.
  • content-type Declares the MIME type and the document's character encoding. The content attribute must have the value "text/html; charset=utf-8" if specified. This is equivalent to a <meta> element with the charset attribute specified and carries the same restriction on placement within the document. Note: Can only be used in documents served with a text/html — not in documents served with an XML MIME type.
  • default-style Sets the name of the default CSS style sheet set.
  • x-ua-compatible If specified, the content attribute must have the value "IE=edge". User agents are required to ignore this pragma.
  • refresh This instruction specifies:
    • The number of seconds until the page should be reloaded - only if the content attribute contains a non-negative integer.
    • The number of seconds until the page should redirect to another - only if the content attribute contains a non-negative integer followed by the string ';url=', and a valid URL.
    The timer starts when the page is completely loaded, which is after the load and pageshow events have both fired.

    Warning:

    Pages set with a refresh value run the risk of having the time interval being too short. People navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. The abrupt, unannounced updating of the page content may also be disorienting for people experiencing low vision conditions.

name

The name and content attributes can be used together to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value.

See standard metadata names for details about the set of standard metadata names defined in the HTML specification.

Examples

html

<meta charset="utf-8" /><!-- Redirect page after 3 seconds --><meta http-equiv="refresh" content="3;url=https://www.mozilla.org" />

Technical summary

Content categories Metadata content. If the itemprop attribute is present: flow content, phrasing content.
Permitted content None; it is a void element.
Tag omission Must have a start tag and must not have an end tag.
Permitted parents
  • <meta charset>, <meta http-equiv>: a <head> element. If the http-equiv is not an encoding declaration, it can also be inside a <noscript> element, itself inside a <head> element.
  • <meta name>: any element that accepts metadata content.
  • <meta itemprop>: any element that accepts metadata content or flow content.
Implicit ARIA role No corresponding role
Permitted ARIA roles No role permitted
DOM interface HTMLMetaElement

Specifications

Specification
HTML Standard
# the-meta-element

Browser compatibility

BCD tables only load in the browser

See also

  • Standard metadata names
  • Learn: <meta>
  • The viewport meta tag
<meta>: The metadata element - HTML: HyperText Markup Language | MDN (2024)

FAQs

<meta>: The metadata element - HTML: HyperText Markup Language | MDN? ›

The <meta> HTML element represents metadata that cannot be represented by other HTML meta-related elements, like <base> , <link> , <script> , <style> or <title> .

What is metadata element in HTML? ›

Definition and Usage

The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data. <meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.

What is the meta for language in HTML? ›

What is the "content-language" Meta Tag? The "content-language" tag is a meta tag in the <head> of an HTML document that states the language and country of that a page 's content is most relevant for. When setting the language, follow the 2-letter ISO 639 language code, just as you would for the HTML language tag.

What is an example of a meta tag? ›

Example of Meta description tag code: <meta name="description" content="This is a meta description. This text will show up in Google's search engine results page.">

How do I add a meta description in HTML? ›

Adding a Meta tag to your website.
  1. Edit the file that contains the head section of your webpage.
  2. Find the <title> HTML tag in the the head section.
  3. Paste the following code after the <title> tag. <meta name="description" content="This is the description of my website" />
Aug 16, 2021

What is an example of metadata? ›

Some examples of basic metadata are author, date created, date modified, and file size. Metadata is also used for unstructured data such as images, video, web pages, spreadsheets, etc. Web pages often include metadata in the form of meta tags.

What is meta used for? ›

Meta tags are pieces of information you use to tell the search engines and those viewing your site more about your page and the information it contains. Meta tags include: Title tags: the title of your page, which should be unique for every page you publish. Meta description: a description of the content on the page.

What is name in meta HTML? ›

The HTML <meta> name Attribute is used to specify the name for the metadata. This attribute is used to define the name for the information/value of the content attribute. Note: If the http-equiv attribute is set, the name attribute should not be set. Syntax: <meta name="value">

How do I add an image in a meta tag? ›

Metatag content configuration

Update the Metatag settings for content (/admin/config/search/metatag/node). Populate the Advanced > Image field with the appropriate token for the image. field_content_image is the machine name for the field on the content type.

What are meta tags for dummies? ›

Meta tags are HTML elements that provide information about your webpages to search engines and users. <meta name="description" content="It's time to get backlinks that make a difference. Backlinko is the place for next-level SEO training and link building strategies.">

How do I find my meta tags? ›

If you want to find out whether a given page is using meta tags, just right-click anywhere on the page and select “View Page Source.” A new tab will open in Chrome (in Firefox, it'll be a pop-up window). The part at the top, or “head” of the page, is where the meta tags would be.

How do I create a meta tag? ›

To add the meta description tag to your website page, locate the <meta name=" description" content= "Content goes here." > section of the HTML code. A meta description is an important piece of information for search engines and users.

Why use meta tags in HTML? ›

It helps in defining the page's title, encoding, author, and viewport settings, etc. These tags are not visible on the web page but play a vital role in structuring and categorizing content for browsers and search engines. Note: The meta tag also accepts Global Attributes in HTML.

What is a meta description in Google search? ›

A meta description tag generally informs and interests users with a short, relevant summary of what a particular page is about. They are like a pitch that convince the user that the page is exactly what they're looking for.

How to check the meta description of a website? ›

It's impossible to see your Meta Description by simply visiting your webpage. Browsers do NOT display the Meta Description. Only search engines read and use this information. So again we need to view the source code (aka HTML code) just like we did to find the Title.

What is an element in metadata? ›

A metadata element is an important piece of information about a document or article, such as titles, authors, and keywords, that helps in organizing and retrieving information. It is crucial for search engines to accurately index and retrieve relevant content.

What does a metadata tag do? ›

Metadata tagging is the process of creating a term that describes a keyword or phrase and assigning those tags to a media asset. A media asset, as described in our blogs about digital asset management and media asset management, is any content that comes in one of five forms: audio, images, video, documents, or HTML.

What do you mean by metadata? ›

Metadata means "data about data". Metadata is defined as the data providing information about one or more aspects of the data; it is used to summarize basic information about data that can make tracking and working with specific data easier. Some examples include: Means of creation of the data. Purpose of the data.

Do HTML files have metadata? ›

It contains information such as the page <title> , links to CSS (if you choose to style your HTML content with CSS), links to custom favicons, and other metadata (data about the HTML, such as the author, and important keywords that describe the document).

Top Articles
Who is Brooke Monk? Biography, Age, Boyfriend, Net Worth, Instagram, Height, Earrings, YouTube, Twitter
10 Things You Didn’t Know about TikTok’s Brooke Monk
Walgreens Harry Edgemoor
Faint Citrine Lost Ark
How Much Is 10000 Nickels
라이키 유출
Visustella Battle Core
Craigslist Greenville Craigslist
Nexus Crossword Puzzle Solver
Best Restaurants Ventnor
Persona 4 Golden Taotie Fusion Calculator
Pro Groom Prices – The Pet Centre
Charmeck Arrest Inquiry
How to Store Boiled Sweets
Calmspirits Clapper
Peraton Sso
Arboristsite Forum Chainsaw
Missed Connections Dayton Ohio
Craigslist Personals Jonesboro
Timeforce Choctaw
Never Give Up Quotes to Keep You Going
Doublelist Paducah Ky
Red Cedar Farms Goldendoodle
UMvC3 OTT: Welcome to 2013!
Belledelphine Telegram
4Oxfun
Villano Antillano Desnuda
TMO GRC Fortworth TX | T-Mobile Community
Craftybase Coupon
Gopher Carts Pensacola Beach
Average weekly earnings in Great Britain
The Hoplite Revolution and the Rise of the Polis
Everstart Jump Starter Manual Pdf
Navigating change - the workplace of tomorrow - key takeaways
Heavenly Delusion Gif
Telegram update adds quote formatting and new linking options
Ticket To Paradise Showtimes Near Regal Citrus Park
Prior Authorization Requirements for Health Insurance Marketplace
Hireright Applicant Center Login
St Anthony Hospital Crown Point Visiting Hours
Armageddon Time Showtimes Near Cmx Daytona 12
Go Bananas Wareham Ma
Dinar Detectives Cracking the Code of the Iraqi Dinar Market
Linkbuilding uitbesteden
Mychart University Of Iowa Hospital
Csgold Uva
Beds From Rent-A-Center
Craigslist Chautauqua Ny
Dietary Extras Given Crossword Clue
Craigslist Pet Phoenix
Ocean County Mugshots
Elizabethtown Mesothelioma Legal Question
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 5795

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.