css3中伪类选择器:表示将很多标签放在一起通过选择第几个进行修饰
当所有的标签名称是一样的时候:将所有相同的标签组成一个集合,再从集合内选择
<!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>
div:first-child{color: blue;}
div:last-child{color: blue;}
div:nth-child(4){color:日blue;}
div:nth-last-child(2){color:blue;}
</style>
</head>
<body>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
<div>男同学</div>
</body>
</html>