html5语义化标签

49 阅读1分钟

是语义化提示作用,告诉开发者,这里是干什么的,更简洁明了一些,大部分标签的css样式就是普通的div、span等

常见的语义化标签

<main>
    <header>
      <h1>标题</h1>
      <p>内容</p>
    </header>
   <pre>
       格式化
       多好多  好

    </pre>
    <p>Do not forget to buy <mark>milk</mark> today.</p>

    <nav>
        <a href=" /html/">HTML</a> |
        <a href=" /css/">CSS</a> |
        <a href=" /js/">JavaScript</a> |
        <a href=" /jquery/">jQuery</a>
    </nav>
    <p>We open at <time>10:00</time> every morning.</p>
    <p>We open at 10:00 every morning.</p>

    <p>I have a date on <time datetime="2008-02-14 20:00">Valentines day</time>.</p>
    <footer>
      <p>底部</p>
    </footer>

    <section>
      <h1>标题</h1>
      <p>内容</p>
    </section>

    <hgroup>
      <h1> Recall Fan Page </h1>
      <h2> Only for people who want the memory of a lifetime. </h2>
    </hgroup>

    <aside>
      <h4>Epcot Center</h4>
      <p>The Epcot Center is a theme park in Disney World, Florida.</p>
    </aside>


  </main>