如何确定具有Microdata的锚标签的价值? [英] How is Value determined for an Anchor Tag with Microdata?
问题描述
Google和其他人如何确定Anchor标记上 itemprop
的值?
How do Google and others determine the value of an itemprop
on an Anchor tag?
<a href="foo.html" itemprop="barprop">Name Of Link</a>
在上面的例子中,itemprop的值是 href
属性,就像解析链接
标签一样?或者是值 innerHTML
,作为标准块元素被解析?
In the example above, is the itemprop's value the href
attribute, much like how the link
tag is parsed? Or is the value the innerHTML
, as a standard block element is parsed?
我已经搜索了很多并找不到答案。我愿意接受所有答案,但我非常喜欢给出答案的来源,以便我可以进一步调查。
I've searched quite a bit and cannot find the answer. I'm open to all answers, but I'd very much like a source for the answers given so I can further investigate.
预先感谢!
推荐答案
Microdata规范(现在只是W3C 注)定义了:
The Microdata spec (which is now merely W3C Note) defines:
如果元素是
a
,区域
或链接
元素
该值是通过解析元素相对于元素的值href
属性的绝对URL在设置属性的时候,或者如果没有这样的属性,或者解决它会导致错误,则为空字符串。
If the element is an
a
,area
, orlink
element
The value is the absolute URL that results from resolving the value of the element'shref
attribute relative to the element at the time the attribute is set, or the empty string if there is no such attribute or if resolving it results in an error.
例外:当 a
/ 区域
/ 链接
元素有一个 itemscope
属性,那么 itemprop
值是由eleme创建的项目nt,而不是 href
值。
Exception: when the a
/area
/link
element has an itemscope
attribute, then the itemprop
"value is the item created by the element", not the href
value.
这篇关于如何确定具有Microdata的锚标签的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!