0 Comments

添加博客帖子和评论

发布于:2013-09-04  |   作者:广州网站建设  |   已聚集:人围观

添加博客帖子和评论

现在,我们有了一个页面,它带有页眉、页脚、导航、包含几篇文章(博客帖子)的内容区域,每篇文章都有自己的页眉和页脚。但博客怎能没有评论呢?规范提到了这种情况,并且推荐使用嵌套的<article>。当嵌套了article元素,内部的article元素表示大体上与外围的article内容相关联的文章。例如,站点上的一个博客条目,它接受用户提交的评论,那么,可以把评论表示为嵌套在博客条目的article元素内部的article元素。

还要注意博客评论通常按照时间顺序出现,并且没有作者的名称和URL这样的信息,简而言之,没有页眉信息,如图2.3所示。
广州网站建设,网站建设,广州网页设计,广州网站设计

代码正如你所期待的,评论部分高亮显示:

  1. <article> 
  2.   <header> 
  3.     <h1>Come to my party on <time datetime=  
  4.       2010-12-01>1 December</time></h1> 
  5.       <p>Published on <time datetime=2010-06-20 pubdate> 
  6.       20 June 2010</time></p> 
  7. </header> 
  8.  
  9.   <p>I'm throwing a party at Dr Einstein's Cabaret  
  10.    Roller-disco Bierkeller Pizza-parlour-a-gogo. Do come  
  11.    and dance to Rusty Trombone's Swingin' Brass Band.  
  12.    (Formal dress and lewd hat required.)</p> 
  13. <footer>Published in the Parrtay!! category by Bruce  
  14.    </footer> 
  15. <article> <!-- comment --> 
  16.   <header> 
  17.    Comment from <a href="http://remysharp.com">Remy  
  18.     Sharp</a> at <time datetime="2010-05-01T08:45Z"> 
  19.     8.45 on 1 May 2010</time> 
  20. </header> 
  21. <p>I'll be there. I very much enjoy a bit of Rusty  
  22.  Trombone.</p> 
  23. </article> <!-- end comment --> 
  24. <article> <!-- comment --> 
  25.  <header> 
  26.   Comment from <a href="http://splintered.co.uk">Patrick  
  27.    Lauke</a> at <time datetime="2010-05-02T10:45Z">10.45  
  28.    on 2 May 2010</time> 
  29. </header> 
  30. <p>Sorry mate. Am washing my hair.</p> 
  31. </article> <!-- end comment --> 
  32. </article> <!-- end blogpost --> 
 
飞机