blob: 754177afeee1b4305d0def82dbfa54e797749969 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
---
title: '::-webkit-progress-bar'
slug: 'Web/CSS/::-webkit-progress-bar'
tags:
- CSS
- 非标准特性
translation_of: 'Web/CSS/::-webkit-progress-bar'
---
<div>{{CSSRef}}{{Non-standard_header}}</div>
<h2 id="概述">概述</h2>
<p><strong><code>::-webkit-progress-bar</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> <a href="/en-US/docs/Web/CSS/Pseudo-elements">伪元素</a> 选择 {{HTMLElement("progress")}} 元素的未完成部分。 {{ cssxref("::-webkit-progress-value") }} 选择完成的部分。<strong><code>::-webkit-progress-bar</code></strong> 是{{cssxref("::-webkit-progress-inner-element")}} 伪元素的子元素,同时是 {{cssxref("::-webkit-progress-value")}} 伪元素的父元素。</p>
<div class="note">
<p><strong>Note:</strong> 为了能让<code>::-webkit-progress-value</code>起作用,需要添加CSS {{cssxref("-webkit-appearance")}} 至 <code><progress></code> 元素.</p>
</div>
<h2 id="规范">规范</h2>
<p>没有规范。这是一个 WebKit/Blink 独有的规范。</p>
<h2 id="例子">例子</h2>
<h3 id="CSS_content">CSS content</h3>
<pre class="brush: css notranslate">progress {
-webkit-appearance: none;
}
::-webkit-progress-bar {
background-color: orange;
}
</pre>
<h3 id="HTML_content">HTML content</h3>
<pre class="brush: html notranslate"><progress value="10" max="50">
</pre>
<h3 id="Output">Output</h3>
<p>{{EmbedLiveSample("Example", 200, 50)}}</p>
<p>应用了上述样式的进度条样式如下:</p>
<p><img alt="" src="https://mdn.mozillademos.org/files/13488/progress-bar.png" style="height: 43px; width: 194px;"></p>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>{{CompatibilityTable}}</p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Firefox (Gecko)</th>
<th>Chrome</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Firefox Mobile (Gecko)</th>
<th>Android</th>
<th>IE Phone</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatNo}}</td>
<td>{{CompatVersionUnknown}}</td>
<td>{{CompatVersionUnknown}}</td>
</tr>
</tbody>
</table>
</div>
<h2 id="参见">参见</h2>
<ul>
<li>The pseudo-elements used by WebKit/Blink to style other parts of a {{HTMLElement("progress")}} element:
<ul>
<li>{{ cssxref("::-webkit-progress-value") }}</li>
<li>{{ cssxref("::-webkit-progress-inner-element") }}</li>
</ul>
</li>
<li>{{ cssxref("::-moz-progress-bar") }}</li>
<li>{{ cssxref("::-ms-fill") }}</li>
</ul>
|