元素
html元素表示一个页面的一部分, 它的内容跟这个页面的其它内容的关联性不强,或者是没有关联,单独存在。元素通常显示成侧边栏(sidebar)或一些插入补充内容。通常用来在侧边栏显示一些定义,比如目录、索引、术语表等;也可以用来显示相关的广告宣传,作者的介绍,web应用,相关链接,当前页内容简介等。
元素使用注意事项:
不要使用元素标记括号中的文字,因为这种类型的文本被认为是主内容的一部分。
使用例子:
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元素)等。
元素用法:
当元素嵌套使用时,则该元素代表与父元素有关的文章。例如,代表博客评论的元素可嵌套在代表博客文章的元素中。
元素中文章作者的信息可通过元素表示,但是不适用于嵌套的元素。
元素中文章的发布日期和时间可通过元素的pubdate属性表示。
代码样例
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>