添加博客帖子和评论
现在,我们有了一个页面,它带有页眉、页脚、导航、包含几篇文章(博客帖子)的内容区域,每篇文章都有自己的页眉和页脚。但博客怎能没有评论呢?规范提到了这种情况,并且推荐使用嵌套的<article>。当嵌套了article元素,内部的article元素表示大体上与外围的article内容相关联的文章。例如,站点上的一个博客条目,它接受用户提交的评论,那么,可以把评论表示为嵌套在博客条目的article元素内部的article元素。
还要注意博客评论通常按照时间顺序出现,并且没有作者的名称和URL这样的信息,简而言之,没有页眉信息,如图2.3所示。
广州网站建设,网站建设,广州网页设计,广州网站设计
![]() |
- <article>
- <header>
- <h1>Come to my party on <time datetime=
- 2010-12-01>1 December</time></h1>
- <p>Published on <time datetime=2010-06-20 pubdate>
- 20 June 2010</time></p>
- </header>
- <p>I'm throwing a party at Dr Einstein's Cabaret
- Roller-disco Bierkeller Pizza-parlour-a-gogo. Do come
- and dance to Rusty Trombone's Swingin' Brass Band.
- (Formal dress and lewd hat required.)</p>
- <footer>Published in the Parrtay!! category by Bruce
- </footer>
- <article> <!-- comment -->
- <header>
- Comment from <a href="http://remysharp.com">Remy
- Sharp</a> at <time datetime="2010-05-01T08:45Z">
- 8.45 on 1 May 2010</time>
- </header>
- <p>I'll be there. I very much enjoy a bit of Rusty
- Trombone.</p>
- </article> <!-- end comment -->
- <article> <!-- comment -->
- <header>
- Comment from <a href="http://splintered.co.uk">Patrick
- Lauke</a> at <time datetime="2010-05-02T10:45Z">10.45
- on 2 May 2010</time>
- </header>
- <p>Sorry mate. Am washing my hair.</p>
- </article> <!-- end comment -->
- </article> <!-- end blogpost -->




