Nestet Microdata结构与Schema.org [英] Nestet Microdata structure with Schema.org
问题描述
< div itemscope =itemtype =http: //schema.org/WebPage\">
< div itemprop =creator>
< div itemscope =itemtype =http://schema.org/Article>
< / div>
< / div>
< / div>
-
这个结构是否正确嵌套?
-
是否
itemprop =name
属于itemtype =http://schema.org / Article
? -
我可以在两个或多个
itemprop
一个元素? $ c> itemprop =creator必须在与 -
itemprop =name
不应在a
中指定。如果您在a
, URL(位于href
)就是名字。作为一种解决方案,您可以添加一个span
(作为子或作为a
的父项)。 - 属性名称
url
,而不是URL
。 - 您的结账
a
标记必须为< / a>
,而不是< a />
。 -
创建者
属性链接到个人或组织,而不是文章。所以要么你的意思是,要么你应该使用不同的财产。也许你的意思是关于
?
itemscope相同的元素上
所以这会给你:
< div itemscope itemtype =http://schema.org/WebPage>
< div itemprop =creatoritemscope itemtype =http://schema.org/Person>
< / div>
<! - 和/或 - >
< div itemprop =aboutitemscope itemtype =http://schema.org/Article>
< / div>
< / div>
剂量
itemprop =name
属于itemtype =http://schema.org/Article
?
是的,总是到最近的父母 itemscope
。
我可以在一个元素中使用两个或多个
itemprop
吗?
不,您不能在同一元素上添加多个 itemprop
属性。但是,您可以在 itemprop
属性中包含多个属性。
但是,请确保所有属性都具有相同的值。 Schema.org的 name
(期望 Text )和 url
(期望 URL )。如果在 a
上指定,则该值将是 href
属性的值,而不是 a
元素。
Can you please tell me if this structure is correct?
<div itemscope="" itemtype="http://schema.org/WebPage">
<div itemprop="creator">
<div itemscope="" itemtype="http://schema.org/Article">
<a itemprop="URL" itemprop="name"><a/>
</div>
</div>
</div>
Is this structure correctly nested?
Does
itemprop="name"
belong toitemtype="http://schema.org/Article"
?Can I use two or more
itemprop
in one element?
itemprop="creator"
must be on the same element as theitemscope
.itemprop="name"
should not be specified ona
. If you have it ona
, the URL (inhref
) would be the name. As a solution, you could add aspan
(as child or as parent ofa
).- The property name is
url
, notURL
. - Your closing
a
tag has to be</a>
, not<a/>
. - The
creator
property links to a Person or Organization, not an Article. So either you meant that, or you should use a different property. Maybe you meanabout
?
So this would give you:
<div itemscope itemtype="http://schema.org/WebPage">
<div itemprop="creator" itemscope itemtype="http://schema.org/Person">
<a itemprop="url"href="…"><span itemprop="name">…</span></a>
</div>
<!-- and/or -->
<div itemprop="about" itemscope itemtype="http://schema.org/Article">
<a itemprop="url" href="…"><span itemprop="name">…</span></a>
</div>
</div>
Dose
itemprop="name"
belong toitemtype="http://schema.org/Article"
?
Yes, always to its nearest parent itemscope
.
Can I use two or more
itemprop
in one element?
No, you can’t add several itemprop
attributes on the same element. But you can have several properties in one itemprop
attribute.
However, make sure that all the properties expect the same value. This is not the case with Schema.org’s name
(expects Text) and url
(expects URL). If specified on a
, the value will be the value of the href
attribute, not the value of the a
element.
这篇关于Nestet Microdata结构与Schema.org的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!