网络编程
位置:首页>> 网络编程>> 网页设计>> HTML 5 预览(2)

HTML 5 预览(2)

作者:zhaozy 来源:蓝色理想 发布时间:2008-01-24 12:17:00 

标签:HTML,W3C,元素,css,HTML,5

header元素表示一个区块的头部, "头部" 可能包含不只是区块的标题, 比如头部包含了副标题, 历史版本信息或是署名都是合理的.

<header>
  <h1>A Preview of HTML 5</h1>
  <p class="byline">By Lachlan Hunt</p>
</header>
<header>
  <h1>Example Blog</h1>
  <h2>Insert tag line here.</h2>
</header>

footer元素表示用上它的那个区块的脚部, 一个具代表性的 "脚部" 包括了这个区块的一些信息, 比如谁写了它, 链接到相关的文档, 版权信息等等.

<footer>&copy; 2007 Example Inc.</footer>

nav元素表示一个导航链接的区块. 它同时适用于站点导航和目录.

<nav>
  <ul>
   <li><a href="/">Home</a></li>
   <li><a href="/products">Products</a></li>
   <li><a href="/services">Services</a></li>
   <li><a href="/about">About</a></li>
  </ul>
</nav>

aside元素为了存放和主要内容没有太大关系的内容, 是典型的标记提要内容方法.

<aside>
  <h1>Archives</h1>
  <ul>
   <li><a href="/2007/09/">September 2007</a></li>
   <li><a href="/2007/08/">August 2007</a></li>
   <li><a href="/2007/07/">July 2007</a></li>
  </ul>
</aside>

section元素表示了一份文档或是一个应用程序一般意义上的区块, 比方说章节.

<section>
  <h1>Chapter 1: The Period</h1>
  <p>It was the best of times, it was the worst of times,
  it was the age of wisdom, it was the age of foolishness,
  it was the epoch of belief, it was the epoch of incredulity,
  it was the season of Light, it was the season of Darkness,
  ...</p>
</section>
(引用自<A Tale of Two Cites>)

article元素表示一份文档, 站点的页面中独立的区块. 它适用于类似新闻, blog文章, 论坛帖子或者个人注释这样的内容.

<article id="comment-2">
  <header>
   <h4>
    <a href="#comment-2" rel="bookmark">Comment #2</a>
    by <a href="Jack'>http://example.com/">Jack O'Niell</a>
   </h4>
   <p><time datetime="2007-08-29T13:58Z">August 29th, 2007 at 13:58</time></p>
  </header>
  <p>That's another great article!</p>
</article>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com