What is Microdata Vocabulary in HTML5?

JavascriptWeb DevelopmentFront End Scripts

To define microdata vocabulary you need a namespace URL that points to a working web page. For example, http://data-vocabulary.org/Person can be used as the namespace for a personal microdata vocabulary with the following named properties −

  • name − Person name as a simple string
  • Photo − A URL to a picture of the person.
  • URL − A website belonging to the person.

Using about properties a person microdata could be as follows:

<html>
   <body>
      <div itemscope>
         <section itemscope itemtype = "http://data-vocabulary.org/Person">
            <h1 itemprop = "name">Gopal K Varma</h1>
            <p>
               <img itemprop = "photo" src = "http://www.tutorialspoint.com/green/images/logo.png">
            </p>
            <a itemprop = "url" href = "#">Site</a>
         </section>
      </div>
   </body>
</html>
raja
Published on 10-Apr-2018 13:55:54
Advertisements