Skip to content

Commit 2256984

Browse files
xyy94813yin1999
andauthored
zh-cn: translate CSSKeyValue value property (#26060)
Co-authored-by: Allo <[email protected]>
1 parent 5b7a9ff commit 2256984

File tree

1 file changed

+37
-0
lines changed
  • files/zh-cn/web/api/csskeywordvalue/value

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: CSSKeywordValue:value 属性
3+
slug: Web/API/CSSKeywordValue/value
4+
l10n:
5+
sourceCommit: d76defab4ca13261e9de81ae1df125345f847b0a
6+
---
7+
8+
{{APIRef("CSS Typed Object Model API")}}
9+
10+
{{domxref("CSSKeywordValue")}} 接口的 **`value`** 属性返回或设置 `CSSKeywordValue` 的值。
11+
12+
##
13+
14+
字符串。
15+
16+
### 异常
17+
18+
- {{jsxref("TypeError")}}
19+
- : 如果 `value` 属性被设置为空字符串则抛出此异常。
20+
21+
## 示例
22+
23+
以下示例重设 CSS 的 {{cssxref('display')}} 属性为其默认值
24+
25+
```js
26+
let indicator = document.getElementById("indicator");
27+
indicator.attributeStyleMap.set("display", new CSSKeywordValue("initial"));
28+
indicator.attributeStyleMap.get("display").value; // 'initial'
29+
```
30+
31+
## 规范
32+
33+
{{Specifications}}
34+
35+
## 浏览器兼容性
36+
37+
{{Compat}}

0 commit comments

Comments
 (0)