diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/stylesheet/disabled/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/stylesheet/disabled/index.html')
-rw-r--r-- | files/zh-cn/web/api/stylesheet/disabled/index.html | 57 |
1 files changed, 57 insertions, 0 deletions
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 +--- +<div>{{APIRef("CSSOM")}}</div> + +<div>{{domxref("StyleSheet")}}接口的 <strong><code>disabled</code> </strong>属性用于决定样式表是否被禁用于文档。</div> + +<div>样式表被禁用可能由于这个属性被手动设置为 <font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);">true</span></font>,也可能是因为样式表是未激活的<a href="https://wiki.developer.mozilla.org/en-US/docs/Web/CSS/Alternative_style_sheets">alternative style sheet</a>。注意 <code>disabled == false</code> 并不保证样式表一定生效(例如它可能被移除出文档)。</div> + +<h2 id="Syntax" name="Syntax">语法</h2> + +<pre class="syntaxbox"><em>bool</em> = stylesheet.disabled +</pre> + +<h2 id="Example" name="Example">例子</h2> + +<pre>// 如果样式表被禁用 +if (stylesheet.disabled) { + // 添加行内样式 +} +</pre> + +<h2 id="Specification" name="Specification">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">注释</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName("CSSOM", "#dom-stylesheet-disabled", "StyleSheet.disabled")}}</td> + <td>{{Spec2("CSSOM")}}</td> + <td>No change from {{SpecName("DOM2 Style")}}.</td> + </tr> + <tr> + <td>{{SpecName("DOM2 Style", "stylesheets.html#StyleSheets-StyleSheet-disabled", "StyleSheet.disabled")}}</td> + <td>{{Spec2("DOM2 Style")}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<p>{{Compat("api.StyleSheet.disabled")}}</p> |