HTML itemprop Attribute
Last Updated :
01 Sep, 2022
The HTML itemprop attribute is a global attribute, that is basically used to add a property to an item. This is used to add extra information to the web page so that it can be relevant and more specifically searched by the search engines.
Syntax:
<div itemscope itemtype="URL">
<span itemprop="itemNumber1">name of the item</span>
<span itemprop="itemNumber2">name of the item</span>
</div>
The below examples demonstrate the HTML itemprop attribute:
Example 1: In this example, the itemprop attribute is used to specify the property of the span element. It helps search engines to understand that the item in the div is about “geeksforgeeks” having a description as “GeeksForGeeks is an awesome website that covers articles on the majority of the topics on Computer Science field” and having article “Dynamic programming”.
HTML
<!DOCTYPE html>
< html >
< body >
< h1 >GeeksForGeeks</ h1 >
< h4 >Articles</ h4 >
< div itemscope itemtype =
< span itemprop = "description" >
GeeksForGeeks is an awesome
website that covers
articles on majority of the
topics on Computer Science field
</ span >
< br >< br >
Article : < span itemprop = "article" >
Dynamic programming
</ span >
</ div >
</ body >
</ html >
|
Output:
HTML itemprop Attribute
Example 2: In this example, the search engines can understand that given div has a URL that contains “Information” about a film named “Avengers” which is of genre “Action” and is directed by “Russo Brothers”.
HTML
<!DOCTYPE html>
< html >
< body >
< div itemscope itemtype =
< h1 itemprop = "name" >Avengers</ h1 >
< br >
< span >Directors :
< span itemprop = "Directors" >
Russo Brothers
</ span >
</ span >
< br >
< span >Genre :
< span itemprop = "genre" >
Action
</ span >
</ span >
< br >
< a itemprop = "Information"
href =
Information
</ a >
</ div >
</ body >
</ html >
|
Output:
HTML itemprop Attribute
Supported Browsers:
- Google Chrome
- Microsoft Edge 12 and above
- Firefox
- Opera
- Safari
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...