aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/preferredstylesheetset/index.html
blob: b567cb2bf4985b35a3a31eb4761f4309b26be717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: Document.preferredStyleSheetSet
slug: Web/API/Document/preferredStyleSheetSet
translation_of: Web/API/Document/preferredStyleSheetSet
---
<div>{{APIRef("DOM")}}{{gecko_minversion_header("1.9")}}</div>

<p><strong><code>preferredStyleSheetSet</code></strong> 属性会依网页作者的喜好回传阶层样式集。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"><var>preferredStyleSheetSet</var> = document.preferredStyleSheetSet
</pre>

<p><code>preferredStyleSheetSet</code> 指的是作者偏好的阶层样式集。内容取决于阶层样式集的次序与 <code>Default-Style</code> HTTP 标头内容.</p>

<p>如果作者没有定义偏好的阶层样式集,就会回传空白的("")字符串。</p>

<h2 id="范例">范例</h2>

<pre class="brush: js">if (document.preferredStyleSheetSet) {
  console.log("The preferred style sheet set is: " + document.preferredStyleSheetSet);
} else {
  console.log("There is no preferred style sheet.");
}
</pre>

<h2 id="规范">规范</h2>

<ul>
 <li><a href="http://www.whatwg.org/specs/web-apps/current-work/#alternate-style-sheets" title="http://www.whatwg.org/specs/web-apps/current-work/#alternate-style-sheets">HTML5: Alternate Style Sheets</a></li>
</ul>

<h2 id="浏览器相容性">浏览器相容性</h2>



<p>{{Compat("api.Document.preferredStyleSheetSet")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>{{domxref("document.lastStyleSheetSet")}}</li>
 <li>{{domxref("document.selectedStyleSheetSet")}}</li>
 <li>{{domxref("document.styleSheetSets")}}</li>
 <li>{{domxref("document.enableStyleSheetsForSet()")}}</li>
</ul>