我看到各种视频丰富代码段示例。我不明白的是,有时人们会使用标签,有时会使用标签来标记相同的内容。 有某种规则或意义吗?取决于我使用的是什么结果不同?
谢谢!
答案 0 :(得分:0)
以下面举例说明。假设我想要包含未呈现给查看者的项目的元数据。比如他们进入meta标签的开放时间。请注意,它们仍然作为mon和fri的标记包装在父span中,这些标记将呈现给查看器。这使得所有五天都成为一个项目。
这些以及靠近底部的地理标记标签是在Google's Rich Snippet Tool中试用的简单示例,用于根据嵌套方式查看标记的解释方式。
<span itemprop="hasPOS">
<span itemprop="contactPoint" itemscope="" itemtype="http://schema.org/ContactPoint">
<a href="tel:13039482988" itemprop="telephone"><i class="icon-phone blue"></i>303-948-2988</a>
</span><br>
<span itemprop="address" itemscope="" itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">7921 S. Platte Canyon Rd</span><br>
<span itemprop="addressLocality" itemscope="" itemtype="http://schema.org/City">
<span itemprop="name">Littleton,</span>
</span>
<span itemprop="addressRegion" itemscope="" itemtype="http://schema.org/State">
<span itemprop="name">Colorado</span>
</span><br>
<span itemprop="postalCode">80128</span>
</span><br>
<span itemprop="openingHours" itemscope="" itemtype="http://schema.org/OpeningHoursSpecification">
<span itemprop="dayOfWeek">
<span itemscope="" itemtype="http://schema.org/DayOfWeek/Monday">Monday</span>
</span>-
<span itemprop="dayOfWeek">
<span itemscope="" itemtype="http://schema.org/DayOfWeek/Friday">Friday</span>
</span>7am - 6pm
<meta itemprop="dayOfWeek" itemtype="http://schema.org/DayOfWeek/Tuesday" content="Tuesday" />
<meta itemprop="dayOfWeek" itemtype="http://schema.org/DayOfWeek/Wednesday" content="Wednesday" />
<meta itemprop="dayOfWeek" itemtype="http://schema.org/DayOfWeek/Thursday" content="Thursday" />
<meta itemprop="opens" itemtype="http://schema.org/Time" content="19:00:00Z-06:00" />
<meta itemprop="closes" itemtype="http://schema.org/Time" content="08:00:00Z-06:00" />
</span>
<span itemprop="geo" itemscope="" itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="39.572216" />
<meta itemprop="longitude" content="-105.056745" />
</span>
</span>