# 계층 선택자

## 계층선택자

![](https://2439846445-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MJPDwYT4PgCDLbVhviR%2F-MJPfmD3bGBxWI4ckL3n%2F-MJPg0SHeyN3qjAxoVko%2Fimage.png?alt=media\&token=0ee6b614-d0cf-4c6d-a9b3-205a4b94db13)

```javascript
$(".list li").css({backgroundColor:"#bbdefb", border:"1px dashed #303f9f"});    //하위 선택자
$(".list > li").css({backgroundColor:"#bbdefb", border:"1px dashed #303f9f"});    //자식 선택자
$(".list5 + li").css({backgroundColor:"#bbdefb", border:"1px dashed #303f9f"});    //형제 선택자
$(".list5 ~ li").css({backgroundColor:"#bbdefb", border:"1px dashed #303f9f"});    //형제들 선택자
```
