aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/cssstyledeclaration
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/cssstyledeclaration
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/cssstyledeclaration')
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/getpropertycssvalue/index.html61
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/getpropertypriority/index.html119
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/getpropertyvalue/index.html71
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/index.html98
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/item/index.html117
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/length/index.html108
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/removeproperty/index.html125
-rw-r--r--files/zh-cn/web/api/cssstyledeclaration/setproperty/index.html137
8 files changed, 836 insertions, 0 deletions
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
+---
+<p>{{ APIRef("CSSOM") }} {{Obsolete_header}}</p>
+
+<p><strong>CSSStyleDeclaration.getPropertyCSSValue()</strong> 方法接口返回一个{{domxref('CSSValue')}} 包含一个属性的CSS值。请注意,如果属性名称是速记属性,则返回null。</p>
+
+<p>现在你应该使用 {{domxref("CSSStyleDeclaration.getPropertyValue()")}}。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">let <em>value</em> = <em>style</em>.getPropertyCSSValue(<em>property</em>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>property</code></em> is a {{domxref('DOMString')}} representing the property name to be retrieved.</li>
+</ul>
+
+<h3 id="返回值">返回值</h3>
+
+<ul>
+ <li><code><em>value</em></code> is a {{domxref('CSSValue')}} containing the CSS value for a property. If none exists, returns <code>null</code>.</li>
+</ul>
+
+<h2 id="示例">示例</h2>
+
+<p>The following JavaScript code gets an object containing the computed RGB values of the <code>color</code> CSS property:</p>
+
+<pre class="brush: js">var style = window.getComputedStyle(elem, null);
+var rgbObj = style.getPropertyCSSValue('color').getRGBColorValue();
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td>Declared as obsolete in <a href="https://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html">July 2003</a>.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性"><strong>浏览器兼容性</strong></h2>
+
+<p>{{Compat("api.CSSStyleDeclaration.getPropertyCSSValue")}}</p>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/getpropertypriority/index.html b/files/zh-cn/web/api/cssstyledeclaration/getpropertypriority/index.html
new file mode 100644
index 0000000000..a2881f7aa9
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/getpropertypriority/index.html
@@ -0,0 +1,119 @@
+---
+title: CSSStyleDeclaration.getPropertyPriority()
+slug: Web/API/CSSStyleDeclaration/getPropertyPriority
+tags:
+ - API
+ - CSSDOM
+ - Method
+ - Reference
+translation_of: Web/API/CSSStyleDeclaration/getPropertyPriority
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p><strong>CSSStyleDeclaration.getPropertyPriority() </strong>方法会根据传入的CSS属性,返回一个 {{domxref('DOMString')}} 来表示该属性的优先级。</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var <em>priority</em> = <em>style</em>.getPropertyPriority(<em>property</em>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>property</code></em> 是一个{{domxref('DOMString')}},表示要检查的属性名。</li>
+</ul>
+
+<h3 id="返回值">返回值</h3>
+
+<ul>
+ <li><code><em>priority</em></code> 是一个{{domxref('DOMString')}},用以表示属性优先级。存在,就返回(例如:<code>"important"</code>);不存在,则返回空字符串。</li>
+</ul>
+
+<h2 id="例子">例子</h2>
+
+<p>下面的代码检查了<code>margin</code>,在CSS规则中是否被设置为 important 优先级。</p>
+
+<pre class="brush: js">var declaration = document.styleSheets[0].cssRules[0].style;
+var isImportant = declaration.getPropertyPriority('margin') === 'important';
+</pre>
+
+<h2 id="标准">标准</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSSOM', '#dom-cssstyledeclaration-getpropertypriority', 'CSSStyleDeclaration.getPropertyPriority()')}}</td>
+ <td>{{Spec2('CSSOM')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性"><strong>浏览器兼容性</strong></h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <thead>
+ <tr>
+ <th scope="col">Feature</th>
+ <th scope="col">Chrome</th>
+ <th scope="col">Edge</th>
+ <th scope="col">Firefox (Gecko)</th>
+ <th scope="col">Internet Explorer</th>
+ <th scope="col">Opera</th>
+ <th scope="col">Safari (WebKit)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/getpropertyvalue/index.html b/files/zh-cn/web/api/cssstyledeclaration/getpropertyvalue/index.html
new file mode 100644
index 0000000000..c5eff00183
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/getpropertyvalue/index.html
@@ -0,0 +1,71 @@
+---
+title: CSSStyleDeclaration.getPropertyValue()
+slug: Web/API/CSSStyleDeclaration/getPropertyValue
+tags:
+ - CSSOM
+ - Reference
+ - getComputedStyle
+ - getPropertyValue
+ - setProperty
+ - 参考
+ - 方法
+ - 标签
+translation_of: Web/API/CSSStyleDeclaration/getPropertyValue
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p><strong>CSSStyleDeclaration.getPropertyValue()</strong> 接口返回一个 {{domxref('DOMString')}} ,其中包含请求的CSS属性的值。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">var <em>value</em> = <em>style</em>.getPropertyValue(<em>property</em>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>property</code></em> 是一个 {{domxref('DOMString')}},是需要查询的CSS 属性名称。</li>
+</ul>
+
+<h3 id="返回值">返回值</h3>
+
+<ul>
+ <li><code><em>value</em></code> 是 {{domxref('DOMString')}} ,包含查找属性的值。若对应属性没有设置,则返回空字符串。</li>
+</ul>
+
+<h2 id="示例">示例</h2>
+
+<p>下述示例使用一个CSS选择器规则查询对应的<code>margin</code> 属性的值:</p>
+
+<pre class="brush: js">var declaration = document.styleSheets[0].cssRules[0].style;
+var value = declaration.getPropertyValue('margin'); // "1px 2px"
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSSOM', '#dom-cssstyledeclaration-getpropertyvalue', 'CSSStyleDeclaration.getPropertyValue()')}}</td>
+ <td>{{Spec2('CSSOM')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性"><strong>浏览器兼容性</strong></h2>
+
+<p>{{Compat("api.CSSStyleDeclaration.getPropertyValue")}}</p>
+
+<div id="compat-mobile"></div>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/index.html b/files/zh-cn/web/api/cssstyledeclaration/index.html
new file mode 100644
index 0000000000..0a8fd0ae45
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/index.html
@@ -0,0 +1,98 @@
+---
+title: CSSStyleDeclaration
+slug: Web/API/CSSStyleDeclaration
+tags:
+ - API
+ - CSSOM
+ - 参考
+ - 接口
+translation_of: Web/API/CSSStyleDeclaration
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p><strong><code>CSSStyleDeclaration</code></strong> 接口表示一个对象,它是一个 CSS 声明块,CSS 属性键值对的集合。它暴露了样式信息和各种与样式相关的方法和属性。</p>
+
+<p><code>CSSStyleDeclaration</code> 对象可被暴露于三种不同的 API 下:</p>
+
+<ul>
+ <li>{{domxref("HTMLElement.style")}},用于操作单个元素的样式(<code>&lt;elem style="..."&gt;</code>)。</li>
+ <li>{{domxref("CSSStyleSheet")}} API,举个例子,<code>document.styleSheets[0].cssRules[0].style</code> 会返回文档中第一个样式表中的第一条 CSS 规则。</li>
+ <li>{{domxref("Window.getComputedStyle()")}},将 <code>CSSStyleDeclaration</code> 对象作为一个<strong>只读</strong>的接口。</li>
+</ul>
+
+<h2 id="属性">属性</h2>
+
+<dl>
+ <dt>{{domxref("CSSStyleDeclaration.cssText")}}</dt>
+ <dd>当前声明块的文本内容。设置此属性会改变样式。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.length")}}</dt>
+ <dd>属性的数量。参照下面的 {{domxref("CSSStyleDeclaration.item()", 'item()')}} 方法。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.parentRule")}}</dt>
+ <dd>包含当前声明块的 {{domxref("CssRule")}}。</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<dl>
+ <dt>{{domxref("CSSStyleDeclaration.getPropertyPriority()")}}</dt>
+ <dd>返回可选的优先级,"important"。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.getPropertyValue()")}}</dt>
+ <dd>返回给定属性的值。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.item()")}}</dt>
+ <dd>返回用index标记的属性名,当index越界时返回空字符串。</dd>
+ <dd>另一个可选方案:使用nodeList[<var>i</var>](在i越界时返回 undefined)获取。通常在非JavaScript Dom 实现方案是很有用。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.removeProperty()")}}</dt>
+ <dd>从 CSS 声明块中删除属性。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.setProperty()")}}</dt>
+ <dd>在CSS声明块中修改现有属性或设置新属性。</dd>
+ <dt>{{domxref("CSSStyleDeclaration.getPropertyCSSValue()")}} {{obsolete_inline}}</dt>
+ <dd><strong>仅在火狐浏览器中支持 getComputedStyle.</strong> 返回 {{ domxref("CSSPrimitiveValue") }} or <code>null</code> for <a href="/en-US/docs/Web/CSS/Shorthand_properties" title="en/Guide to Shorthand CSS">shorthand properties</a>.</dd>
+</dl>
+
+<h2 id="范例">范例</h2>
+
+<pre class="brush: js notranslate">var styleObj = document.styleSheets[0].cssRules[0].style;
+console.log(styleObj.cssText);
+
+for (var i = styleObj.length; i--;) {
+ var nameString = styleObj[i];
+ styleObj.removeProperty(nameString);
+}
+
+console.log(styleObj.cssText);</pre>
+
+<h2 id="规范">规范</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', '#the-cssstyledeclaration-interface', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('CSSOM')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.CSSStyleDeclaration")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li><a href="/zh-CN/docs/Web/CSS/CSS_Properties_Reference">DOM CSS Properties</a></li>
+</ul>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/item/index.html b/files/zh-cn/web/api/cssstyledeclaration/item/index.html
new file mode 100644
index 0000000000..f3e5350ef9
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/item/index.html
@@ -0,0 +1,117 @@
+---
+title: CSSStyleDeclaration.item()
+slug: Web/API/CSSStyleDeclaration/item
+translation_of: Web/API/CSSStyleDeclaration/item
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p id="Summary"><span class="seoSummary"><code>CSSStyleDeclaration.item()</code> 通过下标从 {{domxref('CSSStyleDeclaration')}} 返回一个 CSS 属性值</span>。只要传入参数这个方法就不会抛出异常; 当传入的下标越界时会返回空字符串,当未传入参数时会抛出一个 <code>TypeError</code> 。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">var <em>propertyName</em> = <em>style</em>.item(<em>index</em>);
+</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>index</code></em> 是需要查找节点的索引,索引下标从零开始。</li>
+</ul>
+
+<h3 id="Return_value">Return value</h3>
+
+<ul>
+ <li><em><code>propertyName</code></em> 是一个 {{domxref('DOMString')}} ,是在特定索引位置下的属性的名称。</li>
+</ul>
+
+<p>使用以下的 javascript 语法可以通过索引从 style 的节点列表中获取对应值:</p>
+
+<pre class="syntaxbox">var propertyName = style[index];
+</pre>
+
+<h2 id="范例">范例</h2>
+
+<pre class="brush: js">var style = document.getElementById('div1').style;
+var propertyName = style.item(1); // or simply style[1] - returns the second style listed</pre>
+
+<h2 id="规范">规范</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSSOM', '#dom-cssstyledeclaration-item', 'CSSStyleDeclaration.item()')}}</td>
+ <td>{{Spec2('CSSOM')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<p><strong>浏览器兼容性</strong></p>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <thead>
+ <tr>
+ <th scope="col">Feature</th>
+ <th scope="col">Chrome</th>
+ <th scope="col">Edge</th>
+ <th scope="col">Firefox (Gecko)</th>
+ <th scope="col">Internet Explorer</th>
+ <th scope="col">Opera</th>
+ <th scope="col">Safari (WebKit)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/length/index.html b/files/zh-cn/web/api/cssstyledeclaration/length/index.html
new file mode 100644
index 0000000000..4075f9f4a4
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/length/index.html
@@ -0,0 +1,108 @@
+---
+title: CSSStyleDeclaration.length
+slug: Web/API/CSSStyleDeclaration/length
+translation_of: Web/API/CSSStyleDeclaration/length
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p>这是一个只读的属性,它返回一个指定元素声明过的样式个数</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">var <em>num</em> = <em>styles</em>.length;</pre>
+
+<h3 id="值">值</h3>
+
+<p>指定元素上明确声明过的样式属性个数.</p>
+
+<h2 id="示例">示例</h2>
+
+<p>获取下面HTML元素明确设置过的属性个数:</p>
+
+<pre class="brush: html">&lt;div id="div1" style="margin: 0 10px; background-color: #CA1; font-family: monospace"&gt;&lt;/div&gt;</pre>
+
+<p>JavaScript代码:</p>
+
+<pre>var myDiv = document.getElementById('div1'); var divStyle = myDiv.style; var len = divStyle.length; // 6</pre>
+
+<h2 id="说明">说明</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-cssstyledeclaration-length', 'CSSStyleDeclaration.length')}}</td>
+ <td>工作草案</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>废弃</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<p><strong>浏览器兼容性</strong></p>
+
+<p>兼容性列表</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <thead>
+ <tr>
+ <th scope="col">特性</th>
+ <th scope="col">Chrome</th>
+ <th scope="col">Edge</th>
+ <th scope="col">Firefox (Gecko)</th>
+ <th scope="col">Internet Explorer</th>
+ <th scope="col">Opera</th>
+ <th scope="col">Safari (WebKit)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>基础支持</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/removeproperty/index.html b/files/zh-cn/web/api/cssstyledeclaration/removeproperty/index.html
new file mode 100644
index 0000000000..b4437515b3
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/removeproperty/index.html
@@ -0,0 +1,125 @@
+---
+title: CSSStyleDeclaration.removeProperty()
+slug: Web/API/CSSStyleDeclaration/removeProperty
+tags:
+ - API
+ - CSSOM
+ - Method
+ - Reference
+translation_of: Web/API/CSSStyleDeclaration/removeProperty
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p><code>CSSStyleDeclaration.removeProperty()</code> 方法移除style对象的一个属性。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush: js">var <em>oldValue</em> = <em>style</em>.removeProperty(<em>property</em>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>property</code></em> 是一个 {{domxref('DOMString')}} ,代表要移除的属性名。注意由多个单词组成的属性要用连字符连接各个单词,不接收驼峰命名法的形式。</li>
+</ul>
+
+<h3 id="返回值">返回值</h3>
+
+<ul>
+ <li><code><em>oldValue</em></code> 是一个 {{domxref('DOMString')}} ,等于被移除的属性在移除前的属性值。</li>
+</ul>
+
+<h3 id="异常">异常</h3>
+
+<ul>
+ <li>{{domxref('DOMException')}} NO_MODIFICATION_ALLOWED_ERR: 如果属性或声明块为只读,抛出此异常。</li>
+</ul>
+
+<h2 id="例子">例子</h2>
+
+<p>下面的 JavaScript 代码从样式表里移除了 <code>margin</code> 属性:</p>
+
+<pre class="brush: js">var declaration = document.styleSheets[0].rules[0].style;
+var oldValue = declaration.removeProperty('margin');
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSSOM', '#dom-cssstyledeclaration-removeproperty', 'CSSStyleDeclaration.removeProperty()')}}</td>
+ <td>{{Spec2('CSSOM')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>{{Spec2('DOM2 Style')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器支持情况">浏览器支持情况</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <thead>
+ <tr>
+ <th scope="col">Feature</th>
+ <th scope="col">Chrome</th>
+ <th scope="col">Edge</th>
+ <th scope="col">Firefox (Gecko)</th>
+ <th scope="col">Internet Explorer</th>
+ <th scope="col">Opera</th>
+ <th scope="col">Safari (WebKit)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/cssstyledeclaration/setproperty/index.html b/files/zh-cn/web/api/cssstyledeclaration/setproperty/index.html
new file mode 100644
index 0000000000..269faaad26
--- /dev/null
+++ b/files/zh-cn/web/api/cssstyledeclaration/setproperty/index.html
@@ -0,0 +1,137 @@
+---
+title: CSSStyleDeclaration.setProperty()
+slug: Web/API/CSSStyleDeclaration/setProperty
+translation_of: Web/API/CSSStyleDeclaration/setProperty
+---
+<p>{{ APIRef("CSSOM") }}</p>
+
+<p><span class="seoSummary"><strong><code>CSSStyleDeclaration.setProperty()</code></strong> 方法接口为一个声明了CSS样式的对象设置一个新的值 。</span></p>
+
+<h2 id="语法">语法</h2>
+
+<pre><em>style</em>.setProperty(<em>propertyName</em>, <em>value, priority</em>);</pre>
+
+<h3 id="参数">参数</h3>
+
+<ul>
+ <li><em><code>propertyName</code></em> 是一个 {{domxref('DOMString')}} ,代表被更改的CSS属性。</li>
+ <li><em><code>value</code></em>{{optional_inline}} 是一个 {{domxref('DOMString')}} ,含有新的属性值。如果没有指定, 则当作空字符串。
+ <ul>
+ <li>注意: <em><code>value</code></em> 不能包含 <code>"!important"</code> --那个应该使用 <em><code>priority</code></em> 参数.</li>
+ </ul>
+ </li>
+ <li><em><code>priority</code></em>{{optional_inline}} 是一个 {{domxref('DOMString')}} 允许设置 "important" CSS 优先级。如果没有指定, 则当作空字符串。</li>
+</ul>
+
+<h3 id="返回值">返回值</h3>
+
+<ul>
+ <li>{{jsxref('undefined')}}</li>
+</ul>
+
+<h3 id="异常">异常</h3>
+
+<ul>
+ <li>{{domxref('DOMException')}} (NoModificationAllowedError): 如果属性或装饰块为只读的,抛出此异常。</li>
+</ul>
+
+<p>JavaScript 有一个特别的,更简单的在 CSSStyleDeclaration 对象上设置CSS属性值的语法:</p>
+
+<pre class="syntaxbox"><em>style</em>.cssPropertyName = 'value';</pre>
+
+<h2 id="示例">示例</h2>
+
+<p>下面的Javascript代码为一个选中元素样式的 <code>margin</code> 属性设置一个新的值:</p>
+
+<pre class="brush: js">var declaration = document.styleSheets[0].rules[0].style;
+declaration.setProperty('margin', '1px 2px');
+// Equivalent to:
+// declaration.margin = '1px 2px';
+</pre>
+
+<h2 id="说明">  说明</h2>
+
+<table>
+ <thead>
+ <tr>
+ <th scope="col">描述</th>
+ <th scope="col">状态</th>
+ <th scope="col">注释</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('CSSOM', '#dom-cssstyledeclaration-setproperty', 'CSSStyleDeclaration.setProperty()')}}</td>
+ <td>工作草案</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM2 Style', 'css.html#CSS-CSSStyleDeclaration', 'CSSStyleDeclaration')}}</td>
+ <td>被废弃</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <thead>
+ <tr>
+ <th scope="col">特性</th>
+ <th scope="col">Chrome</th>
+ <th scope="col">Edge</th>
+ <th scope="col">Firefox (Gecko)</th>
+ <th scope="col">Internet Explorer</th>
+ <th scope="col">Opera</th>
+ <th scope="col">Safari (WebKit)</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>基础支持</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>特性</th>
+ <th>Android</th>
+ <th>Edge</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ <th>Chrome for Android</th>
+ </tr>
+ <tr>
+ <td>基础支持</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<div>
+<h3 id="want_learn_more">want learn more</h3>
+<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Window/getComputedStyle">getComputedStyle</a><br>
+<a href="https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleDeclaration/getPropertyValue">getPropertyValue</a></div>
+</div>