itemscope HTML global attribute - HTML | MDN
Skip to search
itemscope
HTML global attribute
itemscope
is a boolean
global attribute
that defines the scope of associated metadata. Specifying the
itemscope
attribute for an element creates a new item, which results in a number of name-value pairs that are associated with the element.
A related attribute,
itemtype
, is used to specify the valid URL of a vocabulary (such as
schema.org
) that describes the item and its properties context. In each of the following examples, the vocabulary is from
schema.org
Every HTML element may have an
itemscope
attribute specified. An
itemscope
element that does not have an associated
itemtype
must have an associated
itemref
Note:
Find more about
itemtype
attributes at
Usage notes
itemscope id attributes
When you specify the
itemscope
attribute for an element, a new item is created. The item consists of a group of name-value pairs. For elements with an
itemscope
attribute and an
itemtype
attribute, you may also specify an
id
attribute. You can use the
id
attribute to set a global identifier for the new item. A global identifier allows the item to relate to other items found on pages across the Web.
Examples
Representing structured data for a movie
The following example specifies the
itemtype
as "http://schema.org/Movie", and specifies four related
itemprop
attributes.
itemscope
Itemtype
Movie
itemprop
(itemprop name)
(itemprop value)
itemprop
director
James Cameron
itemprop
genre
Science Fiction
itemprop
name
Avatar
itemprop
Trailer
html
Representing structured data for a recipe
There are four
itemscope
attributes in the following example. Each
itemscope
attribute sets the scope of its corresponding
itemtype
attribute. The
itemtype
s,
Recipe
AggregateRating
, and
NutritionInformation
in the following example are part of the
schema.org
structured data for a recipe, as specified by the first
itemtype
itemscope
itemtype
Recipe
itemprop
name
Grandma's Holiday Apple Pie
itemprop
image
itemprop
datePublished
2022-11-05
itemprop
description
This is my grandmother's apple pie recipe. I like to add a dash of
nutmeg.
itemprop
prepTime
PT30M
itemprop
cookTime
PT1H
itemprop
totalTime
PT1H30M
itemprop
recipeYield
1 9" pie (8 servings)
itemprop
recipeIngredient
Thinly-sliced apples: 6 cups
itemprop
recipeIngredient
White sugar: 3/4 cup
itemprop
recipeInstructions
1. Cut and peel apples 2. Mix sugar and cinnamon. Use additional sugar
for tart apples.
itemprop
author [Person]
itemprop
name
Carol Smith
itemscope
itemprop[itemtype]
aggregateRating [AggregateRating]
itemprop
ratingValue
4.0
itemprop
reviewCount
35
itemscope
itemprop[itemtype]
nutrition [NutritionInformation]
itemprop
servingSize
1 medium slice
itemprop
calories
250 cal
itemprop
fatContent
12 g
Note:
A handy tool for extracting microdata structures from HTML is Google's
Rich Results Testing Tool
. Try it on the HTML shown here.
HTML
html
Grandma's Holiday Apple Pie
src="https://c1.staticflickr.com/1/30/42759561_8631e2f905_n.jpg"
width="50"
height="50" />
By
Carol Smith
Published:
This is my grandmother's apple pie recipe. I like to add a dash of nutmeg.
itemprop="aggregateRating"
itemscope
itemtype="https://schema.org/AggregateRating">
4.0 stars based on
35 reviews
Prep time:
Cook time:
Total time:
Yield: 1 9" pie (8 servings)
itemprop="nutrition"
itemscope
itemtype="https://schema.org/NutritionInformation">
Serving size: 1 medium slice
Calories per serving: 250 cal
Fat per serving: 12 g
Ingredients:
Thinly-sliced apples: 6 cups
White sugar: 3/4 cup
Directions:
1. Cut and peel apples
2. Mix sugar and cinnamon. Use additional sugar for tart apples.
Result
Specifications
Specification
HTML
# attr-itemscope
See also
Other different global attributes
Other microdata related global attributes:
itemid
itemprop
itemref
itemtype
Help improve MDN
Learn how to contribute
This page was last modified on
Apr 17, 2026
by
MDN contributors
View this page on GitHub
Report a problem with this content