From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../getpropertycssvalue/index.html | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue/index.html (limited to 'files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue') diff --git a/files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue/index.html b/files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue/index.html new file mode 100644 index 0000000000..732ae8229c --- /dev/null +++ b/files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue/index.html @@ -0,0 +1,61 @@ +--- +title: CSSStyleDeclaration.getPropertyCSSValue() +slug: Web/API/CSSStyleDeclaration/getPropertyCSSValue +tags: + - CSSOM + - Obsolete + - Reference +translation_of: Web/API/CSSStyleDeclaration/getPropertyCSSValue +--- +

{{ APIRef("CSSOM") }} {{Obsolete_header}}

+ +

CSSStyleDeclaration.getPropertyCSSValue() 方法接口返回一个{{domxref('CSSValue')}} 包含一个属性的CSS值。请注意,如果属性名称是速记属性,则返回null。

+ +

现在你应该使用 {{domxref("CSSStyleDeclaration.getPropertyValue()")}}。

+ +

语法

+ +
let value = style.getPropertyCSSValue(property);
+ +

参数

+ + + +

返回值

+ + + +

示例

+ +

The following JavaScript code gets an object containing the computed RGB values of the color CSS property:

+ +
var style = window.getComputedStyle(elem, null);
+var rgbObj = style.getPropertyCSSValue('color').getRGBColorValue();
+
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}{{Spec2('DOM2 Style')}}Declared as obsolete in July 2003.
+ +

浏览器兼容性

+ +

{{Compat("api.CSSStyleDeclaration.getPropertyCSSValue")}}

-- cgit v1.2.3-54-g00ecf