aboutsummaryrefslogtreecommitdiff
path: root/files/pl/web/api/cssstylesheet/insertrule/index.html
blob: 28c2c6f01a66e5e43b511bf645a20022bb2e5c0b (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
37
38
39
40
41
42
43
---
title: stylesheet.insertRule
slug: Web/API/CSSStyleSheet/insertRule
tags:
  - DOM
  - Dokumentacja_Gecko_DOM
  - Gecko
  - Strony_wymagające_dopracowania
  - Wszystkie_kategorie
translation_of: Web/API/CSSStyleSheet/insertRule
original_slug: Web/API/Stylesheet/insertRule
---
<p>{{APIRef("CSSOM")}}</p>

<h3 id="Podsumowanie" name="Podsumowanie">Podsumowanie</h3>

<p>Metoda <strong>insertRule</strong> dodaje nową regułę stylu do aktualnego arkuszu stylu.</p>

<h3 id="Sk.C5.82adnia" name="Sk.C5.82adnia">Składnia</h3>

<pre class="eval">stylesheet.insertRule(<em>rule</em>, <em>index</em>)
</pre>

<h3 id="Parametry" name="Parametry">Parametry</h3>

<ul>
 <li><code>rule</code> jest ciągiem zawierającym regułę do dodania (selector i declaration).</li>
 <li><code>index</code> jest liczbą reprezentującą pozycję do dodania.</li>
</ul>

<h3 id="Przyk.C5.82ad" name="Przyk.C5.82ad">Przykład</h3>

<pre> // push a new rule onto the top of my stylesheet
 myStyle.insertRule("#blanc { color: white }", 0);
</pre>

<h3 id="Uwagi" name="Uwagi">Uwagi</h3>

<p>For rule sets this contains both the selector and the style declaration. For at-rules, this specifies both the at-identifier and the rule content.</p>

<h3 id="Specyfikacja" name="Specyfikacja">Specyfikacja</h3>

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