<meta/> Tag Syntax

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet ...?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      ... metadata content ...
      <meta http-equiv="..." content="..."/>
      ... metadata content ...
      <title>My Title</title>
      ... metadata content ...
      <meta name="..." content="..."/>
      ... metadata content ...
   </head>
   <body>
      ... flow content expected ...
      <meta itemprop="..." content="..."/>
      ...
      ... phrasing content expected ...
      <meta itemprop="..." content="..."/>
      ...
   </body>
</html>
Rules for coding the HTML meta element

Make sure you understand the difference between a tag and element and are familiar with the definitions of namespace and other HTML terms.

<meta/> tag as metadata content
  1. Code any <meta> tags in the <head> section of the HTML document where metadata content is expected.
  2. Each meta element consists of a standalone <meta/> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the xmlns attribute on the <html> tag.
  3. Code either a name attribute or an http-equiv attribute, but not both. The value of the attribute, which is enclosed in double quotes, is the name of the metadata or directive.
  4. Code the content attribute with the value for the named metadata or directive in double quotes.
  5. Since the <meta/> tag is a void element, it should always be coded as a self-closing tag terminated with the delimiter string />.
<meta/> tag for microdata properties
  1. Code the <meta> tag in the <body> section of the HTML document where either flow content or phrasing content is expected.
  2. The meta element consists of a standalone <meta/> tag. The element name uses lower case letters and should be in the HTML namespace, which it will pick up automatically from the xmlns attribute on the <html> tag.
  3. Inside the <meta> tag, include an itemprop attribute to indicate the meta element represents a microdata property. The value of the attribute, which is enclosed in double quotes, is the name or URL of the microdata property.
  4. Inside the <meta> tag, code a content attribute with the value of the microdata property in double quotes.
  5. Since the <meta/> tag is a void element, it should always be coded as a self-closing tag terminated with the delimiter string />.

<meta/> Content Model

Contents of the meta element

Content: Empty. All properties are coded using attributes.

Since the <meta/> tag is a void element, it is not allowed to have any content, even HTML comments and therefore should always be coded as a self-closing standalone tag, ending with the delimiters /> rather than just > (<meta .../>).