zoukankan      html  css  js  c++  java
  • HTML5新元素

    1. <figure> 标签规定独立的流内容(图像、图表、照片、代码等等)。

        <figure> 元素的内容应该与主内容相关,同时元素的位置相对于主内容是独立的。如果被删除,则不应对文档流产生影响

        <figcaption> 标签为 <figure> 元素定义标题。

        <figcaption> 元素应该被置于 <figure> 元素的第一个或最后一个子元素的位置。

    IE 9+、Firefox、Opera、Chrome 和 Safari 都支持 <article> 标签。

    注释: IE 8 或更早版本的 IE 浏览器不支持 <article> 标签。

    <!DOCTYPE html>
    <html>
    <body>
    
    <p>The Pulpit Rock is a massive cliff 604 metres (1982 feet) above Lysefjorden, opposite the Kjerag plateau, in Forsand, Ryfylke, Norway. The top of the cliff is approximately 25 by 25 metres (82 by 82 feet) square and almost flat, and is a famous tourist attraction in Norway.</p>
    
    <figure>
      <img src="img_pulpit.jpg" alt="The Pulpit Rock" width="304" height="228">
      <figcaption>Fig.1 - A view of the pulpit rock in Norway.</figcaption>
    </figure>
    
    </body>
    </html>
    

      

      2.<aside> 标签定义 <article> 标签外的内容

        aside 的内容应该与附近的内容相关

        <aside> 的的内容可用作文章的侧栏。

    IE 9+、Firefox、Opera、Chrome 和 Safari 都支持 <aside> 标签。

    注释: IE 8 或更早版本的 IE 浏览器不支持 <aside> 标签。

      3.<command> 标签可以定义用户可能调用的命令(比如单选按钮、复选框或按钮)。

        目前,主流浏览器都不支持 <command> 标签。

        注释:只有 IE 9 支持 <command> 标签,其他之前版本或者之后版本的 IE 浏览器不支持 <command> 标签。

      4.<details> 标签规定了用户可见的或者隐藏的需求的补充细节。

      <details> 标签用来供用户开启关闭的交互式控件任何形式的内容都能被放在 <details> 标签里边。

      <details> 元素的内容对用户是不可见的,除非设置了 open 属性

    <!DOCTYPE html>
    <html>
    <body>
    
    <details open>
    <summary>Copyright 1999-2011.</summary>
    <p> - by Refsnes Data. All Rights Reserved.</p>
    <p>All content and graphics on this web site are the property of the company Refsnes Data.</p>
    </details>
    
    <p><b>Note:</b> The details tag is currently only supported in Chrome and in Safari 
    6.</p>
    
    </body>
    </html>
    

      

    只有 Chrome 和 Safari 6 支持 <details> 标签。

    提示:与 <summary> 标签配合使用可以为 details 定义标题。标题是可见的,用户点击标题时,会显示出 details。

    <!DOCTYPE html>
    <html>
    <body>
    
    <details >
    <summary>Copyright 1999-2011.</summary>
    <p> - by Refsnes Data. All Rights Reserved.</p>
    <p>All content and graphics on this web site are the property of the company Refsnes Data.</p>
    </details>
    
    <p><b>Note:</b> The details tag is currently only supported in Chrome and in Safari 
    6.</p>
    
    </body>
    </html>
    

      

      5.<footer> 标签定义文档或者文档的一部分区域的页脚 

      <footer> 元素应该包含它所包含的元素的信息。

      在典型情况下,该元素会包含文档创作者的姓名文档的版权信息使用条款的链接联系信息等等。

      在一个文档中,您可以定义多个 <footer> 元素。

    IE 9、Firefox、Opera、Chrome 和 Safari 支持 <footer> 标签。

    注释:IE 8 或更早版本的 IE 浏览器不支持 <footer> 标签。

      6.<header> 标签定义文档或者文档的一部分区域的页眉。

      <header> 元素应该作为介绍内容或者导航链接栏的容器

      在一个文档中,您可以定义多个 <header> 元素

    注释:<header> 标签不能被放在 <footer><address> 或者另一个 <header> 元素内部

      7.<mark> 标签定义带有记号的文本。请在需要突出显示文本时使用 <mark> 标签。

    <!DOCTYPE html>
    <html>
    <body>
    
    <article>
      <header>
        <h1>Internet Explorer 9</h1>
        <p><time pubdate datetime="2011-03-15"></time></p>
      </header>
      <p>Windows Internet Explorer 9 (abbreviated as IE9) was released to
      the  public on March 14, 2011 at 21:00 PDT.....</p>
    </article>
    
    </body>
    </html>
    

      8.<meter> 标签定义度量衡。仅用于已知最大和最小值的度量。

    比如:磁盘使用情况查询结果的相关性等。

    注意: <meter> 不能作为一个进度条来使用, 进度条 <progress> 标签。

    Firefox、Opera、Chrome 和 Safari 6 支持 <meter> 标签。

    <!DOCTYPE html>
    <html>
    <body>
    
    <p>Display a gauge:</p>

    <!--high 属性规定度量的值位于哪个点,被界定为高的值。-->

    <!--high 属性的值必须小于 max 属性的值,且必须大于 low 和 min 属性的值。-->

    <!--optimum 属性规定度量值被界定为最优值的范围。-->

    <!--value 属性是必需的,规定度量的当前值。value 属性的值必须介于 min 和 max 属性的值中间。-->

    <meter value="2" min="0" max="10">2 out of 10</meter><br>
    <meter value="0.6">60%</meter>
    
    <p><strong>Note:</strong> The meter tag is not supported in Internet Explorer.</p>
    
    </body>
    </html>			
    

      9.<nav> 标签定义导航链接的部分。

    目前大多数浏览器支持 <nav> 标签。

    并不是所有的 HTML 文档都要使用到 <nav> 元素。<nav> 元素只是作为标注一个导航链接的区域。

    在不同设备上(手机或者PC)可以制定导航链接是否显示,以适应不同屏幕的需求。

    <!DOCTYPE html>
    <html>
    <body>
    
    <nav>
      <a href="/html/">HTML</a> |
      <a href="/css/">CSS</a> |
      <a href="/js/">JavaScript</a> |
      <a href="/jquery/">jQuery</a>
    </nav>
    
    </body>
    </html>
    			
    

      10.<progress> 标签定义运行中的任务进度(进程)。

    提示:请将 <progress> 标签与 JavaScript 一起使用来显示任务的进度

    注释:<progress> 标签不适合用来表示度量衡(例如,磁盘空间使用情况或相关的查询结果)。表示度量衡,请使用 <meter> 标签代替。

    max 属性规定任务总共需要多少工作。value 属性规定已经完成多少任务。

    <!DOCTYPE html>
    <html>
    <body>
    
    Downloading progress:
    <progress value="22" max="100">
    </progress>
    
    <p><strong>Note:</strong> The progress tag is not supported in Internet Explorer 9 and earlier versions.</p>
    
    </body>
    </html>
    			
    

      11.<ruby> 标签定义 ruby 注释(中文注音或字符)。

      在东亚使用,显示的是东亚字符的发音。

      将 <ruby> 标签与 <rt> 和 <rp> 标签一起使用: 
      <ruby> 元素由一个或多个需要解释/发音的字符和一个提供该信息的 <rt> 元素组成,还包括可选的 <rp> 元素,定义当浏览器不支持 "ruby" 元素时显示的内容

    IE 9+、Firefox、Opera、Chrome 和 Safari 支持 <ruby> 标签。

    注释:IE 8 或更早版本的 IE 浏览器不支持 <ruby> 标签。

    <!DOCTYPE html>
    <html>
    <body>
    
    <ruby>
      漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
      字 <rp>(</rp><rt>ji</rt><rp>)</rp>
    </ruby>
    
    </body>
    </html>
    			
    

      12.<section> 标签定义了文档的某个区域。比如章节、头部、底部或者文档的其他区域。

    IE 9+、Firefox、Opera、Chrome 和 Safari <section> 标签。

    注释:IE 8 或更早版本的 IE 浏览器不支持 <section> 标签。

    <!DOCTYPE html>
    <html>
    <body>
    
    <section>
      <h1>WWF</h1>
      <p>The World Wide Fund for Nature (WWF) is an international organization working on issues regarding the conservation, research and restoration of the environment, formerly named the World Wildlife Fund. WWF was founded in 1961.</p>
    </section>
    
    <section>
      <h1>WWF's Panda symbol</h1>
      <p>The Panda has become the symbol of WWF. The well-known panda logo of WWF originated from a panda named Chi Chi that was transferred from the Beijing Zoo to the London Zoo in the same year of the establishment of WWF.</p>
    </section>
    
    </body>
    </html>
    

      13<wbr> (Word Break Opportunity) 标签规定在文本中的何处适合添加换行符。

    提示:如果单词太长,或者您担心浏览器会在错误的位置换行,那么您可以使用 <wbr> 元素来添加 Word Break Opportunity(单词换行时机)。

    所有主流浏览器都支持 <wbr> 标签,除了 Internet Explorer

    <!DOCTYPE html>
    <html>
    <body>
    
    <p>Try to shrink the browser window, to view how the word "XMLHttpRequest" in 
    the paragraph below will break:</p>
    
    <p>To learn AJAX, you must be familiar with the XML<wbr>Http<wbr>Request Object.</p>
    
    <p><b>Note:</b> The &lt;wbr&gt; tag is not supported in IE.</p>
    
    </body>
    </html>
    			
    

      

  • 相关阅读:
    vite的使用
    webpack--Plugin
    webpack--loader
    uniapp 或小程序,通过蓝牙连接设备, 给设备配网
    每一项与之前一项相加
    vue使用vue-fullpage
    React基礎
    无间隙循环轮播效果
    Wow.js动画效果
    正则表达式
  • 原文地址:https://www.cnblogs.com/shenq/p/5018608.html
Copyright © 2011-2022 走看看