假设我的分数是这样的:

<ul id="comments">

  <li class="comment">
    <div class="author">on Friday 3th, Jenny said:</div>
    <div class="content"><p>bla bla</p></div>
  </li>

  <li class="comment">
    <div class="author">on Friday 3th, Jenny said:</div>
    <div class="content"><p>bla bla</p></div>

    <ul class="level-2">
      <li class="comment">
        <div class="author">on Friday 3th, Mary said:</div>
        <div class="content">stfu jenny</div>
      </li>
    </ul>
  </li>
  ...

如何在此标记上使用“usercomments”项?
http://schema.org/UserComments
在哪里添加?一次在列表容器中,还是多次在每个列表项中?

最佳答案

根据HTML5 Microdata类型化项目规范,您可以将其添加到评论部分的容器中,例如

<section itemscope itemtype="http://example.org/animals#cat">
 <h1 itemprop="name">Hedral</h1>
 <p itemprop="desc">Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.</p>
 <img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>

因此,注释部分的项目范围的格式如下(考虑到项目属性):
<ul id="comments" itemscope itemtype="http://schema.org/UserComments">

  <li class="comment">
    <div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Jenny said:</div>
    <div itemprop="commentText" class="content"><p>bla bla</p></div>
  </li>

  <li class="comment">
    <div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Jenny said:</div>
    <div itemprop="commentText" class="content"><p>bla bla</p></div>

    <ul class="level-2">
      <li class="comment">
        <div itemprop="name" class="author"><span itemprop="commentTime">on Friday 3th</span>, Mary said:</div>
        <div itemprop="commentText" class="content">stfu jenny</div>
      </li>
    </ul>
  </li>
...

08-25 10:31