0

这是代码:

<article>
<img itemprop="name" src="img/product_name.png">
<p>Product text</p>
</article>

通常我可以这样做:

<h3 itemprop="name">Product name here</h3>

有谁知道我该怎么做?

4

2 回答 2

3

请记住,微数据是关于让机器理解您的页面。在图像中隐藏文本则相反,会使任何微数据变得无用。但是您可以在页面中添加正确的元数据而不向访问者显示。

我会这样解决它:

<article itemscope>
  <img itemprop="image" alt="textual name" src="img/product_name.png" />
  <meta itemprop="name" content="textual name" />
  <p>Product text</p>
</article>
于 2013-05-31T05:32:22.653 回答
0

所以就像 Michaël Hompus 说的,你可以我们meta,你可以参考下面的这个链接以获得更多的解释。

这里,一个关于 htmlgoodies 的例子

这是我的例子:

<article itemscope itemtype="http://schema.org/Product">
   <img itemprop="image" src="img/product_name.png">
   <meta itemprop="name" content="name of product here" />
   <p itemprop="description">Product text</p>
</article>

您可以添加更多详细信息:请参见此处

于 2013-07-14T19:04:51.153 回答