<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
ul li:first-of-type {
background-color: pink;
}
ul li:last-of-type {
background-color: pink;
}
ul li:nth-of-type(even) {
background-color: skyblue;
}
/* :nth-child() 会把所有的盒子都排列序号 */
/* 执行的时候先看nth-child(1) 之后回去看前面 div */
/* section div:nth-child(1) {
background-color: red;
} */
/* :nth-of-type()先去匹配e,然后根据e找第n个孩子 */
section div:nth-of-type(1) {
background-color: blue;
}
</style>
</head>
<body>
<ul>
<li>第1个人</li>.
<li>第2个人</li>
<li>第3个人</li>
<li>第4个人</li>
<li>第5个人</li>
<li>第6个人</li>
<li>第7个人</li>
<li>第8个人</li>
</ul>
<!-- 区别 -->
<ul>
<section>
<p>光头强</p>
<div>熊大</div>
<div>熊二</div>
</section>
</ul>
</body>
</html>