blob: a630c0d29d06ab16dce5bc94541a09f6376f8bb9 (
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: CSSRule.parentStyleSheet
slug: Web/API/CSSRule/parentStyleSheet
translation_of: Web/API/CSSRule/parentStyleSheet
---
<p>{{ APIRef("CSSOM") }}</p>
<h3 id="Summary" name="Summary">概述</h3>
<p><strong>parentStyleSheet</strong> 返回在当前规则中已定义的样式表对象。</p>
<h3 id="Syntax" name="Syntax">语法</h3>
<pre class="eval"><em>stylesheet</em> = cssRule.parentStyleSheet
</pre>
<h3 id="Parameters" name="Parameters">参数</h3>
<ul>
<li><code>stylesheet</code>是一个样式表对象。</li>
</ul>
<h3 id="Example" name="Example">例子</h3>
<pre class="eval">if ( bgRule.parentStyleSheet != mySheet ) {
// alien style rule!
}
</pre>
<h3 id="Notes" name="Notes">备注</h3>
<p>查看 <a href="en/Gecko_DOM_Reference/event#DOM_styleSheet_Object">Gecko DOM Reference:event#DOM_styleSheet_Object</a> 有关样式表的对象接口的详细信息。</p>
<h3 id="Specification" name="Specification">规范</h3>
<p>DOM Level 2 Style - cssRule</p>
|