stylesheet.href

Podsumowanie

Zwraca położenie zewnetrznego arkusza stylów.

Składnia

uri = stylesheet.href 

Parametry

  • uri jest łańcuchem zawierającym URI arkusza stylów.

Przykład

 // W lokalnej maszynie: 
 <html> 
  <head> 
   <link rel="StyleSheet" href="example.css" type="text/css" /> 
   <script> 
    function sref() { 
     alert(document.styleSheets[0].href); 
    }
   </script> 
  </head> 
  <body> 
   <div class="thunder">Thunder</div>
   <button onclick="sref()">ss</button>
  </body> 
 </html>
// Zwraca "file:////C:/Windows/Desktop/example.css

Notatki

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.

Specyfikacja

href

Autorzy i etykiety dokumentu

 Autorzy tej strony: teoli, jsx, Internauta1024A, Ptak82
 Ostatnia aktualizacja: jsx,