新建 html 文件 06-div.html
,编写下方程序,运行看看效果吧
<!DOCTYPE html>
<htmllang="en">
<head>
<metacharset="UTF-8">
<metahttp-equiv="X-UA-Compatible"content="IE=edge">
<metaname="viewport"content="width=device-width, initial-scale=1.0">
<title>Div标签</title>
</head>
<body>
<divstyle="width:100px;height:100px; background-color: red;">
分区1
</div>
<div>
<div>分区2
<div>分区22</div>
</div>
<span>span标签</span>
</div>
</body>
</html>