--- title: stylesheet.href slug: Web/API/Stylesheet/href tags: - DOM - Dokumentacja_Gecko_DOM - Gecko - Wszystkie_kategorie translation_of: Web/API/StyleSheet/href ---
{{ ApiRef() }}
Zwraca położenie zewnetrznego arkusza stylów.
uri = stylesheet.href
uri jest łańcuchem zawierającym URI arkusza stylów. // 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
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.