aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/cssrule/csstext
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/cssrule/csstext
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/cssrule/csstext')
-rw-r--r--files/zh-cn/web/api/cssrule/csstext/index.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/cssrule/csstext/index.html b/files/zh-cn/web/api/cssrule/csstext/index.html
new file mode 100644
index 0000000000..6f83ef0b53
--- /dev/null
+++ b/files/zh-cn/web/api/cssrule/csstext/index.html
@@ -0,0 +1,37 @@
+---
+title: CSSRule.cssText
+slug: Web/API/CSSRule/cssText
+translation_of: Web/API/CSSRule/cssText
+---
+<div>
+<div>{{ APIRef("CSSOM") }}</div>
+</div>
+
+<div> </div>
+
+<div><span style="font-size: 2.14285714285714rem; font-weight: 700; letter-spacing: -1px; line-height: 30px;">概述</span></div>
+
+<p><strong>cssText</strong> 返回样式规则所包含的实际文本.想要能够动态的设置一个样式表规则,查看<a href="/en-US/docs/DOM/Using_dynamic_styling_information" title="DOM/Using_dynamic_styling_information">使用动态样式信息.</a></p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox"><em>string</em> = cssRule.cssText
+</pre>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<pre class="brush:html;">&lt;style&gt;
+body { background-color: darkblue; }
+&lt;/style&gt;
+&lt;script&gt;
+ var stylesheet = document.styleSheets[0];
+ alert(stylesheet.cssRules[0].cssText); // body { background-color: darkblue; }
+&lt;/script&gt;
+
+</pre>
+
+<h2 id="Specification" name="Specification">规范</h2>
+
+<ul>
+ <li><a href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule">DOM Level 2 Style CSS - Interface CSSStyleRule (introduced in DOM Level 2)</a></li>
+</ul>