Skip to content

Commit

Permalink
doc: update docs/css.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 30, 2022
1 parent cabda9b commit 19f919f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,22 @@ br + br {
}
```

### 子元素选中父元素

```css
div:has(img) {
background: black;
}
```

设置包含子元素 `img``div` 元素样式,还可以嵌套:

```css
div:has(h2):has(ul) {
background: black;
}
```

另见
---------

Expand Down

0 comments on commit 19f919f

Please sign in to comment.