aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/cssstylesheet/deleterule/index.html
blob: 66346da53f74925fac726fb87eeac25f1016e494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
title: CSSStyleSheet.deleteRule()
slug: Web/API/CSSStyleSheet/deleteRule
translation_of: Web/API/CSSStyleSheet/deleteRule
---
<p>{{ APIRef("CSSOM") }}</p>

<h3 id="Summary" name="Summary">概述</h3>

<p><b>deleteRule</b>方法用来从当前样式表对象中删除指定的样式规则.</p>

<h3 id="Syntax" name="Syntax">语法</h3>

<pre class="eval">stylesheet.deleteRule(<i>index</i>)
</pre>

<h3 id="Parameters" name="Parameters">参数</h3>

<ul>
 <li><code>index是一个数字,用来指定样式规则的位置</code>.</li>
</ul>

<h3 id="Example" name="Example">示例</h3>

<pre> myStyles.deleteRule(0);
</pre>

<h2 id="相关链接">相关链接</h2>

<ul>
 <li><a href="/zh-CN/DOM/CSSStyleSheet/insertRule" title="zh-CN/DOM/CSSStyleSheet/insertRule">insertRule</a></li>
</ul>

<h3 id="Specification" name="Specification">规范</h3>

<p><a class="external" href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleSheet-deleteRule">deleteRule </a></p>