From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/document/stylesheets/index.html | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 files/zh-cn/web/api/document/stylesheets/index.html (limited to 'files/zh-cn/web/api/document/stylesheets/index.html') diff --git a/files/zh-cn/web/api/document/stylesheets/index.html b/files/zh-cn/web/api/document/stylesheets/index.html new file mode 100644 index 0000000000..61c8c2eae2 --- /dev/null +++ b/files/zh-cn/web/api/document/stylesheets/index.html @@ -0,0 +1,25 @@ +--- +title: Document.styleSheets +slug: Web/API/Document/styleSheets +translation_of: Web/API/DocumentOrShadowRoot/styleSheets +--- +
{{APIRef}}
+ +

Document.styleSheets 只读属性,返回一个由 {{domxref("StyleSheet ")}} 对象组成的 {{domxref("StyleSheetList")}},每个 {{domxref("StyleSheet ")}} 对象都是一个文档中链接或嵌入的样式表。

+ +

语法

+ +
let styleSheetList = document.styleSheets;
+
+ +

返回的对象是一个 {{domxref("StyleSheetList")}}。

+ +

它是一个 {{domxref("StyleSheet")}} 对象的有序集合。styleSheetList.item(index) 或 styleSheetList{{ mediawiki.External('index') }} 根据它的索引(索引基于0)返回一个单独的样式表对象。

+ +
 
+ +

规范

+ + -- cgit v1.2.3-54-g00ecf