aboutsummaryrefslogtreecommitdiff
path: root/files/pl/web/api/stylesheet/href/index.html
blob: e0d7661c24b18addcf9a57415452b77d8240ea69 (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
---
title: stylesheet.href
slug: Web/API/Stylesheet/href
tags:
  - DOM
  - Dokumentacja_Gecko_DOM
  - Gecko
  - Wszystkie_kategorie
translation_of: Web/API/StyleSheet/href
---
<p>{{ ApiRef() }}</p>
<h3 id="Podsumowanie" name="Podsumowanie">Podsumowanie</h3>
<p>Zwraca położenie zewnetrznego arkusza stylów.</p>
<h3 id="Sk.C5.82adnia" name="Sk.C5.82adnia">Składnia</h3>
<pre class="eval"><i>uri</i> = stylesheet.href
</pre>
<h3 id="Parametry" name="Parametry">Parametry</h3>
<ul>
 <li><code>uri</code> jest łańcuchem zawierającym URI arkusza stylów.</li>
</ul>
<h3 id="Przyk.C5.82ad" name="Przyk.C5.82ad">Przykład</h3>
<pre> // W lokalnej maszynie:
 &lt;html&gt;
  &lt;head&gt;
   &lt;link rel="StyleSheet" href="example.css" type="text/css" /&gt;
   &lt;script&gt;
    function sref() {
     alert(document.styleSheets[0].href);
    }
   &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
   &lt;div class="thunder"&gt;Thunder&lt;/div&gt;
   &lt;button onclick="sref()"&gt;ss&lt;/button&gt;
  &lt;/body&gt;
 &lt;/html&gt;
// Zwraca "file:////C:/Windows/Desktop/example.css
</pre>
<h3 id="Notatki" name="Notatki">Notatki</h3>
<p>Jeżeli arkusz stylów jest zewnętrznym arkuszem stylów, wartością tego atrybutu jest jego lokalizacja. Dla wewnętrznego arkusza stylów, wartość tego atrybutu wynosi null.</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/stylesheets.html#StyleSheets-StyleSheet-href">href </a></p>