相关疑难解决方法(0)

Microdata可以应用于任何类型的HTML元素吗?

在网络上的所有示例中,我都看到了Microdata属性itemscopeitemtype应用于div元素,如下所示:

<div itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
  <span itemprop="genre">Science fiction</span>
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</div>
Run Code Online (Sandbox Code Playgroud)

但是Microdata可以应用于任何其他元素,在我的情况下,我想将它应用于列表项:

<ul>
<li itemscope itemtype ="http://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span>Director: <span itemprop="director">James Cameron</span> (born August 16, 1954)</span>
  <span itemprop="genre">Science fiction</span>
  <a href="../movies/avatar-theatrical-trailer.html" itemprop="trailer">Trailer</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

这有什么已知的问题吗?

html markup microdata

3
推荐指数
1
解决办法
1798
查看次数

标签 统计

html ×1

markup ×1

microdata ×1