层次选择器
1、后代选择器:在某元素后面 祖爷爷 爷爷爸爸 你
/*后代选择器*/
body p{
background: red;
}
2、子选择器,一代,儿子
/*子选择器*/
body>p{
background: #3cbda6;
}
```
## 3、相邻兄弟选择器 同辈
```html
/*相邻弟选择器: 只有一个,相邻(向下)*/
.active+p{
background: #3cbda6;
}
```
## 4、通用选择器
```html
/*通用兄弟选择器,当前选中元素的向下的所有兄弟元素*/
.active~p{
background: #0022FF;
}
```