HTML   发布时间:2022-04-15  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了html – 如何使用“UserComments”模式项?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
假设我有这样的标记:
<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

我在哪里添加itemscope itemtype =“http://scheR_656_11845@a.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://scheR_656_11845@a.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>
...

大佬总结

以上是大佬教程为你收集整理的html – 如何使用“UserComments”模式项?全部内容,希望文章能够帮你解决html – 如何使用“UserComments”模式项?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。