在网络上的所有示例中,我都看到了Microdata属性itemscope并itemtype应用于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)
这有什么已知的问题吗?