HTMLLinkElement:sheet 属性
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.
HTMLLinkElement
接口的 sheet
只读属性包含与该元素相关联的样式表。
如果 <link>
元素使用了 rel="stylesheet"
,则样式表就与 HTMLLinkElement
相关联。
值
一个 StyleSheet
对象,如果没有与元素关联的样式表,则为 null
。
示例
html
<html>
<header>
<link rel="stylesheet" href="styles.css" />
…
</header>
</html>
HTMLLinkElement
对象的 sheet
属性将返回描述为 styles.css
的 StyleSheet
对象。
规范
Specification |
---|
CSS Object Model (CSSOM) # dom-linkstyle-sheet |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
sheet |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.