本文介绍了我可以在跨度标记中为schema.org丰富网页摘要使用多个ItemProp吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有以下句子,我想添加丰富网页摘要:

Let's say I have the following sentence I want to add rich snippets to:

由于纽约既是我的居住地,也是我工作的城市,理论上我希望使用schema.org标准标记这样的行:

Since New York is both my residency and the city where I work in, I would theoretically want to tag the line like this using schema.org standards:

<div itemscope itemtype = 'http://schema.org/Person'>I live and work in 
<span itemprop = 'homeLocation'  itemprop = 'workLocation'>New York</span></div>

在一个span标签中有两个itemprops是否有效?如果没有,下面的工作会吗?

Is it valid to have 2 itemprops in one span tag? If not, will the below work?

<div itemscope itemtype = 'http://schema.org/Person'>I live and work in 
<span itemprop = 'homeLocation'><span itemprop = 'workLocation'>New York
</span></span></div>


推荐答案

通常的HTML方法是使用一个属性并用空格字符分隔几个值。

The usual HTML way would be to use one attribute and separate several values with space characters.

纵观Microdata规范,您会注意到这是。)

(Note: If using itemprop values as CSS selector, use [att~=val] instead of [att=val].)

这篇关于我可以在跨度标记中为schema.org丰富网页摘要使用多个ItemProp吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 16:25