section与div

简介: section与div

section和div

一、DIV

div即division(区块),把文档分割为独立的、不同的部份。作用,以下三种情况应该用div标签:

  1.用于页面布局,且不是 header、footer 之类的专属区域。

  2.单纯的对一个段内容进行 CSS 样式定义。

  3.对一段内容进行 JS 控制。。

SECTION

1.section在html5中并不是用来取代 div 的。它是具有语义的文档标签。表示一段文档中的章节,比如包含一个标题和一个段落,而大纲规范中,至少要包含一个标题。

2.section 至少需要一个 h1 ~ h6。

3.代码示例

<section>
    <h2>Bootstrap</h2>
    <p>Bootstrap 是一款 html5 开源框架</p>
   </section>

4.注意

body、section需要标题;

header、nav不需要。

目录
打赏
0
0
0
0
9
分享
相关文章
|
8月前
|
前端使用 <el-descriptions>标签报错: <el-descriptions> - did you register the component correctly
前端使用 <el-descriptions>标签报错: <el-descriptions> - did you register the component correctly
456 0
【已解决】Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>
Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>
538 0
【已解决】Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>
HTML5 - section、article和div
HTML5 - section、article和div
114 0
HTML中<button />和<input type=“button“/>的区别
HTML中<button />和<input type=“button“/>的区别
151 0
HTML之<button><select><optgroup>元素详解
一篇了解<button><select><optgroup>元素
216 0
HTML之<button><select><optgroup>元素详解
Mikasa #735-div2
题意:找到n ^ 1 … n ^ m中最小为出现的非负整数
108 0
Mikasa #735-div2
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等