Home  >  Article  >  Web Front-end  >  详解HTML5中的<aside>元素与<article>元素_html5教程技巧

详解HTML5中的<aside>元素与<article>元素_html5教程技巧

WBOY
WBOYOriginal
2016-05-16 15:46:322155browse

HTML

    不要使用

使用例子:

XML/HTML Code复制内容到剪贴板
  1. article>  
  2.   p>  
  3.     The Disney movie em>The Little Mermaidem> was   
  4.     first released to theatres in 1989.   
  5.   p>  
  6.   aside>  
  7.     The movie earned $87 million during its initial release.   
  8.   aside>  
  9.   p>  
  10.     More info about the movie...   
  11.   p>  
  12. article>  


元素
Article元素(
)故名思议,可以表示论坛帖子、杂志或新闻文章、博客、用户提交的评论、交互式组件,或者其他独立的内容项目。它的主要语义为表示自己是一个独立的内容结构。每一个
元素内部结构都应该是相似的,比如都应该包含一个头标题(h1-h6元素)等。

元素用法:

    当

元素嵌套使用时,则该元素代表与父元素有关的文章。例如,代表博客评论的
元素可嵌套在代表博客文章的
元素中。
   
元素中文章作者的信息可通过
元素表示,但是不适用于嵌套的
元素。

   

元素中文章的发布日期和时间可通过

代码样例

XML/HTML Code复制内容到剪贴板
  1. article class="film_review">  
  2.   header>  
  3.     h2>侏罗纪公园h2>  
  4.   header>  
  5.   section class="main_review">  
  6.     p>Dinos were great!p>  
  7.   section>  
  8.   section class="user_reviews">  
  9.     article class="user_review">  
  10.       p>Way too scary for me.p>  
  11.       footer>  
  12.         p>  
  13.           Posted on time datetime="2015-05-16 19:00">May 16time> by Lisa.   
  14.         p>  
  15.       footer>  
  16.     article>  
  17.     article class="user_review">  
  18.       p>I agree, dinos are my favorite.p>  
  19.       footer>  
  20.         p>  
  21.           Posted on time datetime="2015-05-17 19:00">May 17time> by Tom.   
  22.         p>  
  23.       footer>  
  24.     article>  
  25.   section>  
  26.   footer>  
  27.     p>  
  28.       Posted on time datetime="2015-05-15 19:00">May 15time> by Staff.   
  29.     p>  
  30.   footer>  
  31. article>  
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn