File Syntax

HTML Microdata

Based on an HTML document, this encoding processes nodes with Microdata-related attributes, such as itemscope, itemtype, and itemprop. For new implementations, we recommend JSON-LD or RDFa as a more modern and standardized method of embedding structured data.

Example

<html>
  <body>
    <div itemscope itemtype="https://schema.org/WebSite">
      <a href="https://schemamarkup.app/" itemprop="url">
        <span itemprop="name">Schema Markup</span>
      </a>
    </div>
  </body>
</html>

Content Attribute

The content attribute should only be used on a <meta> element in order to specify a machine-friendly value of a property (see Values section of the specification). However, some well-known systems and examples use the content attribute on other elements, too.

Since using the attribute on non-<meta> elements is not be supported by all Microdata parsers, we annotate our usage of the attribute data with a warning.

Try it
WARNING decoder/public.html-microdata#RecoveredSyntaxContentAttribute

The source used a "content" attribute from an unsupported context which may cause inconsistent behavior across clients.

Messages

In addition to the Content Attribute message described above, we also detect other potential concerns.

References

  • Specifications: HTML, Microdata
  • Media Type: application/xhtml+xml (or text/html, text/xhtml)
  • File Name: *.html (or *.htm)