新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 讨论HTML、XHTML、Web2.0、Ajax、XUL, ExtJS, jQuery, JSON、Social Networking System(SNS)、Rich Internet Applications (RIA)、Tagging System、Taxonomy(tagsonomy,folkonomy)、XForms、XFrames、XInclude, XBL (XML Binding Language)等话题
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 HTML/XHTML/Ajax/Web 2.0/Web 3.0 』 → [分享]html5的新元素 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 6549 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [分享]html5的新元素 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     尛尛 美女呀,离线,快来找我吧!水瓶座1991-1-21
      
      
      等级:大二期末(Java考了96分!)
      文章:99
      积分:398
      门派:XML.ORG.CN
      注册:2008/9/11

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给尛尛发送一个短消息 把尛尛加入好友 查看尛尛的个人资料 搜索尛尛在『 HTML/XHTML/Ajax/Web 2.0/Web 3.0 』的所有贴子 引用回复这个贴子 回复这个贴子 查看尛尛的博客楼主
    发贴心情 [分享]html5的新元素

    昨天听了上海网务肖飞老师的一节课,主要讲关于html5的新元素,现将自己所学拿出来分享一下。
       自打2000年以来,超文本标记语言第一次添加了新元素,包括新的结构元素包括 aside、figure 和 section。新的内联元素包括 time、meter 和 progress。新的内嵌元素有 video 和 audio。新的交互元素有 details、datagrid 和 command。
       今天首先讲一下结构元素:

    由于缺少结构,即使是形式良好的 HTML 页面也比较难以处理。必须分析标题的级别,才能看出各个部分的划分方式。边栏、页脚、页眉、导航条、主内容区和各篇文章都由通用的 div 元素来表示。HTML 5 添加了一些新元素,专门用来标识这些常见的结构:

    section:这可以是书中的一章或一节,实际上可以是在 HTML 4 中有自己的标题的任何东西
    header:页面上显示的页眉;与 head 元素不一样
    footer:页脚;可以显示电子邮件中的签名
    nav:指向其他页面的一组链接
    article:blog、杂志、文章汇编等中的一篇文章
    我们来考虑一个典型的 blog 主页,它的顶部有页眉,底部有页脚,还有几篇文章、一个导航区和一个边栏,见清单 1。

    <html>
    <head>
        <title>Mokka mit Schlag </title>
    </head>
    <body>
    <div id="page">
    <div id="header">
        <h1><a href="http://www.elharo.com/blog">Mokka mit Schlag</a></h1>
    </div>
    <div id="container">
        <div id="center" class="column">               
          <div class="post" id="post-1000572">
            <h2><a href=
          "/blog/birding/2007/04/23/spring-comes-and-goes-in-sussex-county/">
          Spring Comes (and Goes) in Sussex County</a></h2>
            
            <div class="entry">
              <p>Yesterday I joined the Brooklyn Bird Club for our
              annual trip to Western New Jersey, specifically Hyper
              Humus, a relatively recently discovered hot spot. It
              started out as a nice winter morning when we arrived
              at the site at 7:30 A.M., progressed to Spring around
              10:00 A.M., and reached early summer by 10:15. </p>
            </div>
          </div>


          <div class="post" id="post-1000571">
            <h2><a href=
              "/blog/birding/2007/04/23/but-does-it-count-for-your-life-list/">
               But does it count for your life list?</a></h2>
            
            <div class="entry">
              <p>Seems you can now go <a
              href="http://www.wired.com/science/discoveries/news/
              2007/04/cone_sf">bird watching via the Internet</a>. I
              haven't been able to test it out yet (20 user
              limit apparently) but this is certainly cool.
              Personally, I can't imagine it replacing
              actually being out in the field by any small amount.
              On the other hand, I've always found it quite
              sad to meet senior birders who are no longer able to
              hold binoculars steady or get to the park. I can
              imagine this might be of some interest to them. At
              least one elderly birder did a big year on TV, after
              he could no longer get out so much. This certainly
              tops that.</p>
            </div>
          </div>

          </div>
        
        <div class="navigation">
          <div class="alignleft">
             <a href="/blog/page/2/">&laquo; Previous Entries</a>
           </div>
          <div class="alignright"></div>
        </div>
    </div>

    <div id="right" class="column">
        <ul id="sidebar">
          <li><h2>Info</h2>
          <ul>
            <li><a href="/blog/comment-policy/">Comment Policy</a></li>
            <li><a href="/blog/todo-list/">Todo List</a></li>
          </ul></li>
          <li><h2>Archives</h2>
            <ul>
              <li><a href='/blog/2007/04/'>April 2007</a></li>
              <li><a href='/blog/2007/03/'>March 2007</a></li>
              <li><a href='/blog/2007/02/'>February 2007</a></li>
              <li><a href='/blog/2007/01/'>January 2007</a></li>
            </ul>
          </li>
        </ul>
    </div>
    <div id="footer">
        <p>Copyright 2007 Elliotte Rusty Harold</p>
    </div>
    </div>

    </body>
    </html>
    下面看一下用html5编写的页面

    <html>
    <head>
        <title>Mokka mit Schlag </title>
    </head>
    <body>
    <header>
        <h1><a href="http://www.elharo.com/blog">Mokka mit Schlag</a></h1>
    </header>
    <section>               
          <article>
            <h2><a href=
            "/blog/birding/2007/04/23/spring-comes-and-goes-in-sussex-county/">
             Spring Comes (and Goes) in Sussex County</a></h2>
            
            <p>Yesterday I joined the Brooklyn Bird Club for our
            annual trip to Western New Jersey, specifically Hyper
            Humus, a relatively recently discovered hot spot. It
            started out as a nice winter morning when we arrived at
            the site at 7:30 A.M., progressed to Spring around 10:00
            A.M., and reached early summer by 10:15. </p>
          </article>


          <article>
            <h2><a href=
              "/blog/birding/2007/04/23/but-does-it-count-for-your-life-list/">
              But does it count for your life list?</a></h2>
            
              <p>Seems you can now go <a
              href="http://www.wired.com/science/discoveries/news/
              2007/04/cone_sf">bird watching via the Internet</a>. I
              haven't been able to test it out yet (20 user
              limit apparently) but this is certainly cool.
              Personally, I can't imagine it replacing
              actually being out in the field by any small amount.
              On the other hand, I've always found it quite
              sad to meet senior birders who are no longer able to
              hold binoculars steady or get to the park. I can
              imagine this might be of some interest to them. At
              least one elderly birder did a big year on TV, after
              he could no longer get out so much. This certainly
              tops that.</p>
          </article>    
        <nav>
          <a href="/blog/page/2/">&laquo; Previous Entries</a>
        </nav>
    </section>

    <nav>
        <ul>
          <li><h2>Info</h2>
          <ul>
            <li><a href="/blog/comment-policy/">Comment Policy</a></li>
            <li><a href="/blog/todo-list/">Todo List</a></li>
          </ul></li>
          <li><h2>Archives</h2>
            <ul>
              <li><a href='/blog/2007/04/'>April 2007</a></li>
              <li><a href='/blog/2007/03/'>March 2007</a></li>
              <li><a href='/blog/2007/02/'>February 2007</a></li>
              <li><a href='/blog/2007/01/'>January 2007</a></li>
            </ul>
          </li>
        </ul>
    </nav>
    <footer>
        <p>Copyright 2007 Elliotte Rusty Harold</p>
    </footer>

    </body>
    </html>

    很简单的东西,不需要div,也没有必要自己去设置class属性,我们完全可以从元素名推出元素的意义。


       收藏   分享  
    顶(1)
      




    ----------------------------------------------
    非凡IT培训:it.phedu.cn 主推:php div+css

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2009/10/4 16:40:00
     
     GoogleAdSense水瓶座1991-1-21
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 HTML/XHTML/Ajax/Web 2.0/Web 3.0 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2025/7/18 13:29:27

    本主题贴数1,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    62.500ms