HTML5语义标签的实践

<article> 定义一篇文章

  • 论坛发帖
  • 博客文章
  • 一篇文章

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

 

<aside> 侧边栏

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


<details> 附加详细信息

<summary> 摘要

<details>
  <summary>Copyright 1999-2014.</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>

除了summary其他内容默认隐藏,当details元素添加了open属性的时候p标签的内容才会显示。


<figcaption> 图片标题
<figure> 定义图片分组

<figure>
  <img src="pic_mountain.jpg" alt="The Pulpit Rock" width="304" height="228">
  <figcaption>Fig1. - The Pulpit Rock, Norway.</figcaption>
</figure>


<footer> 页脚

<footer>

  <p>底部</p>

</footer>


<header> 定义头部

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

通常我们会用到文章的简介里面

<article>
  <header>
    <h1>标题</h1>
    <p>简介</p>
  </header>
  <p>内容</p>
</article>


<main> 定义主体内容

<main>
  <h1>Web Browsers</h1>
  <p>Google Chrome, Firefox, and Internet Explorer are the most used browsers today.</p>

  <article>
    <h1>Google Chrome</h1>
    <p>Google Chrome is a free, open-source web browser developed by Google,
    released in 2008.</p>
  </article>

  <article>
    <h1>Mozilla Firefox</h1>
    <p>Firefox is a free, open-source web browser from Mozilla, released in 2004.</p>
  </article>
</main>


<mark> 定义标记,高亮,需要突出的文字

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


<nav> 定义一组链接

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


<section> 定义块,通常包含一个标题和一段内容

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


<time> 定义时间

<p>We open at <time>10:00</time> every morning.</p>

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

 

<hgroup> 定义标题组

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值