HTML5语义标签的含义是什么

发布时间:2022-05-17 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了HTML5语义标签的含义是什么脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

在htML5中,语义标签能够清楚的描述其意义给浏览器和开发者,也就是尽量使用有相对应的结构的含义的Html的标签,语义标签包括“footer”、“header”、“nav”、“figcaption”标签等等

HTML5语义标签的含义是什么

本教程操作环境:windows10系统、HTML5版、Dell G3脑。

HTML5语义标签的含义是什么

语义= 意义

语义元素 = 有意义的元素

什么是语义元素?

一个语义元素能够清楚的描述其意义给浏览器和开发者。

无语义 元素实例: <div> 和 <span> - 无需考虑内容.

语义元素实例: <form>, <table>, and <img> - 清楚的定义了它的内容.

许多现有网站都包含以下HTML代码: <div id="nav">, <div class="header">, 或者 <div id="footer">, 来指明导航链接, 头部, 以及尾部.

HTML5 提供了新的语义元素来明确一个Web页面的不同部分:

  • <header>

  • <nav>

  • <section>

  • <article>

  • <aside>

  • <figcaption>

  • <figure>

  • <footer>

HTML5语义标签的含义是什么

示例如下:

<section> 标签定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分。

<html>
<head> 
<;meta charset="utf-8"> 
<tITle>123</title> 
</head>
<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&#39;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>

输出结果:

HTML5语义标签的含义是什么

推荐教程:《html视频教程》

以上就是HTML5语义标签的含义是什么的详细内容,更多请关注脚本宝典其它相关文章

脚本宝典总结

以上是脚本宝典为你收集整理的HTML5语义标签的含义是什么全部内容,希望文章能够帮你解决HTML5语义标签的含义是什么所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: