doc: update docs/css.md

This commit is contained in:
jaywcjlove 2023-03-04 10:25:48 +08:00
parent 7facfea3f9
commit 3ddd8d7fea

View File

@ -1811,6 +1811,20 @@ div:has(h2):has(ul) {
}
```
### 获取 HTML 元素的属性
```html
<a href="https://example.com">超链接</a>
```
attr HTML 元素的属性名。
```css
a:after {
content: " (" attr(href) ")";
}
```
另见
---------