StyleSheet: parentStyleSheet 屬性
StyleSheet 介面的 parentStyleSheet 屬性返回包含給定樣式表的樣式表(如果有)。
值
一個 StyleSheet 物件。
示例
js
// Find the top level stylesheet
const sheet = stylesheet.parentStyleSheet ?? stylesheet;
注意
如果當前樣式表是頂級樣式表,或者不支援樣式表包含,則此屬性返回 null。
規範
| 規範 |
|---|
| CSS 物件模型 (CSSOM) # dom-stylesheet-parentstylesheet |
瀏覽器相容性
載入中…