HTML <section> 标签 详解
HTML基础 2022-06-02 09:42:50小码哥的IT人生shichen
HTML <section> 标签
实例
文档中的区段,解释了 PRC:
<section>
<h1>PRC</h1>
<p>The People's Republic of China was born in 1949...</p>
</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>
可以使用本站在线JavaScript测试工具测试上述代码运行效果:http://www.phpcodeweb.com/runjs.html
定义和用法
<section> 标签定义文档中的节(section、区段)。比如章节、页眉、页脚或文档中的其他部分。
浏览器支持
表格中的数字指示了支持此元素的首个浏览器版本。
元素 | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
<section> | 5.0 | 9.0 | 4.0 | 5.0 | 11.5 |
所有浏览器都支持 <section> 标签。
HTML 4.01 与 HTML 5 之间的差异
<section> 标签是 HTML 5 中的新标签。
属性
属性 | 值 | 描述 |
---|---|---|
cite | URL | section 的 URL,假如 section 摘自 web 的话。 |
全局属性
<section> 标签支持 HTML 中的全局属性。
事件属性
<section> 标签支持 HTML 中的事件属性。