How to use Microdata in HTML5

In this article I am groin to explain about microdata attribute in HTML5.
  • 1931

Microdata in HTML5

In Html5 microdata is an lightweight semantic meta syntax. That is use for create nested group of name value pairs of data. Microdata consist of group name-value. In microdata group are called item and it name-value is called properties. For create microdata item we use itemscope attribute and add properties in item we use itemprop. Item and properties are represented by regular element.

Microdata Global Attribute

  • Itemscop - (Its use for create item)
  • Iytemtype - (Its describe a valid url and describe item and its properties)
  • Itemid - (Its define unique id for an element)
  • Itemprop - (Use for add properties in Item)
  • Itemref - (Its gives the list of additional properties)

Browser that supports microdata Attribute

Mozilla firefox, Google chrome, opera Browser

Syntax

<p itemscope>some txt <span itemprop="name">Name</span></p>

 

Example

 

<html>

<head>

</head>

<body>

    <div itemscope>

        <p>

            Name <span itemprop="name">Jown</span>.</p>

        <p>

            Address <span itemprop="Address">New Delhi</span>.</p>

        <p>

            Company Name <span itemprop="CompanyName">Microsoft</span>.</p>

    </div>

</body>

</html>

 

Output

 

micro.jpg


Further Readings

You may also want to read these related articles: here
Ask Your Question 
© 2020 DotNetHeaven. All rights reserved.