Skip to content

Commit 7f6bbcd

Browse files
committed
docs(dom): edit CSS
1 parent bfb850f commit 7f6bbcd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/dom/css.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ div.setAttribute(
1919
<div style="background-color:red; border:1px solid black;" />
2020
```
2121

22+
`style`不仅可以使用字符串读写,它本身还是一个对象,部署了 CSSStyleDeclaration 接口(详见下面的介绍),可以直接读写个别属性。
23+
24+
```javascript
25+
e.style.fontSize = '18px';
26+
e.style.color = 'black';
27+
```
28+
2229
## CSSStyleDeclaration 接口
2330

2431
### 简介

0 commit comments

Comments
 (0)