StyleSheet

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.

表示一个实现 StyleSheet(表示单个样式表)接口的对象。CSS 样式表将进一步实现更具体的 CSSStyleSheet 接口。

实例属性

StyleSheet.disabled

返回表示当前样式表是否可用的布尔值。

StyleSheet.href 只读

返回表示样式表的位置的字符串。

StyleSheet.media 只读

返回表示样式信息的预期目标媒体的 MediaList

StyleSheet.ownerNode 只读

返回将此样式表与当前文档相关联的 Node

StyleSheet.parentStyleSheet 只读

如果有的话,返回 StyleSheet;如果没有,则返回 null

StyleSheet.title 只读

返回表示当前样式表的咨询标题的字符串。

StyleSheet.type只读

返回表示当前样式表的样式表语言的字符串。

规范

Specification
CSS Object Model (CSSOM)
# the-stylesheet-interface

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
StyleSheet
disabled
href
media
ownerNode
parentStyleSheet
title
type

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见