From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/stylesheet/disabled/index.html | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 files/zh-cn/web/api/stylesheet/disabled/index.html (limited to 'files/zh-cn/web/api/stylesheet/disabled/index.html') diff --git a/files/zh-cn/web/api/stylesheet/disabled/index.html b/files/zh-cn/web/api/stylesheet/disabled/index.html new file mode 100644 index 0000000000..a18d5f068f --- /dev/null +++ b/files/zh-cn/web/api/stylesheet/disabled/index.html @@ -0,0 +1,57 @@ +--- +title: StyleSheet.disabled +slug: Web/API/StyleSheet/disabled +tags: + - API + - CSSOM + - Disabled + - Property + - Reference +translation_of: Web/API/StyleSheet/disabled +--- +
{{APIRef("CSSOM")}}
+ +
{{domxref("StyleSheet")}}接口的 disabled 属性用于决定样式表是否被禁用于文档。
+ +
样式表被禁用可能由于这个属性被手动设置为 true,也可能是因为样式表是未激活的alternative style sheet。注意 disabled == false 并不保证样式表一定生效(例如它可能被移除出文档)。
+ +

语法

+ +
bool = stylesheet.disabled
+
+ +

例子

+ +
// 如果样式表被禁用
+if (stylesheet.disabled) {
+   // 添加行内样式
+}
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
规范状态注释
{{SpecName("CSSOM", "#dom-stylesheet-disabled", "StyleSheet.disabled")}}{{Spec2("CSSOM")}}No change from {{SpecName("DOM2 Style")}}.
{{SpecName("DOM2 Style", "stylesheets.html#StyleSheets-StyleSheet-disabled", "StyleSheet.disabled")}}{{Spec2("DOM2 Style")}}Initial definition.
+ +

Browser compatibility

+ +

{{Compat("api.StyleSheet.disabled")}}

-- cgit v1.2.3-54-g00ecf