html
不要使用元素标记括号中的文字,因为这种类型的文本被认为是主内容的一部分。
使用例子:
XML/HTML Code复制内容到剪贴板
- article>
-
p>
-
The Disney movie em>The Little Mermaidem> was
- first released to theatres in 1989.
-
p>
-
aside>
- The movie earned $87 million during its initial release.
-
aside>
-
p>
- More info about the movie...
-
p>
-
article>
元素
Article元素()故名思议,可以表示论坛帖子、杂志或新闻文章、博客、用户提交的评论、交互式组件,或者其他独立的内容项目。它的主要语义为表示自己是一个独立的内容结构。每一个元素内部结构都应该是相似的,比如都应该包含一个头标题(h1-h6元素)等。
立即学习“前端免费学习笔记(深入)”;
元素用法:
当元素嵌套使用时,则该元素代表与父元素有关的文章。例如,代表博客评论的元素可嵌套在代表博客文章的元素中。
元素中文章作者的信息可通过元素表示,但是不适用于嵌套的元素。
元素中文章的发布日期和时间可通过
代码样例
XML/HTML Code复制内容到剪贴板
- article class="film_review">
-
header>
-
h2>侏罗纪公园h2>
-
header>
-
section class="main_review">
-
p>Dinos were great!p>
-
section>
-
section class="user_reviews">
-
article class="user_review">
-
p>Way too scary for me.p>
-
footer>
-
p>
-
Posted on time datetime="2015-05-16 19:00">May 16time> by Lisa.
-
p>
-
footer>
-
article>
-
article class="user_review">
-
p>I agree, dinos are my favorite.p>
-
footer>
-
p>
-
Posted on time datetime="2015-05-17 19:00">May 17time> by Tom.
-
p>
-
footer>
-
article>
-
section>
-
footer>
-
p>
-
Posted on time datetime="2015-05-15 19:00">May 15time> by Staff.
-
p>
-
footer>
-
article>