HTML and CSS Reference
In-Depth Information
</h1>
16.
Create a new
<span>
element around the state text (
NY
).
<h1 itemprop="address" itemscope
itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">310 West 38th Street</span>,
<span>
NY
</span>
</h1>
17.
Add an
itemprop
attribute to this
<span>
element and set its value to
addressRegion.
<h1 itemprop="address" itemscope
itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">310 West 38th Street</span>,
<span
itemprop="addressRegion"
>NY</span>
</h1>
18.
Now locate the
<img>
element and add an
itemprop
attribute to it. Set the value of this attribute to be
image
.
<img src="img/map1.png"
alt="Joe's Pizza at 310 West 38th Street, NY"
itemprop="image"
>
19.
Locate the
<p>
element that contains the location phone number and add an
itemprop
attribute to it. Set
the value of the attribute to be
telephone
.
<p class="location-phone"
itemprop="telephone"
>212 012 3456</p>
20.
You now need to mark up the opening hours. To do this, you need to create a new
<time>
element for
each line that specifies opening hours. Create a new
<time>
element and place the human-readable text
for the Monday to Friday opening hours between the element tags.
<time>
Mon-Fri: 12:00 - 22:00
</time>
21.
Add an
itemprop
attribute to this
<time>
element and set its value to
openingHours
.
<time
itemprop="openingHours"
>Mon-Fri: 12:00 - 22:00</time>
22.
Add a
datetime
attribute to the element and set its value to reflect the opening hours; in this case it
would be:
Mo-Fr 12:00-22:00
. (See the
opening Hours
bullet earlier in this chapter for help with
calculating the value for the
datetime
attribute.)
<time itemprop="openingHours"
datetime="Mo-Fr 12:00-22:00"
>
Mon-Fri: 12:00 - 22:00</time>
23.
Repeat Steps 20 through 22 for each line in the
openingHours
section. Here is how this section should
look when you're done.
<h2>Opening Hours:</h2>
<p>
<time itemprop="openingHours" datetime="Mo-Fr 12:00-22:00">
Mon-Fri: 12:00 - 22:00</time><br>
<time itemprop="openingHours" datetime="Sa,Su 11:00-23:00">
Sat-Sun: 11:00 - 23:00</time>
</p>