HTML
<progress>
element
displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
| 内容类别 | 流内容 , 措词内容 , labelable content, palpable content. |
|---|---|
| 准许内容 |
措词内容
, but there must be no
<progress>
element among its descendants.
|
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts 措词内容 . |
| Implicit ARIA role |
progressbar
|
| Permitted ARIA roles |
No
role
permitted
|
| DOM 接口 |
HTMLProgressElement
|
此元素包括 全局属性 .
max
progress
element requires. The
max
attribute, if present, must have a value greater than
0
and be a valid floating point number. The default value is
1
.
value
0
and
max
, or between
0
and
1
if
max
is omitted. If there is no
value
attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take.
注意:
不像
<meter>
element, the minimum value is always 0, and the
min
attribute is not allowed for the
<progress>
元素。
注意:
:indeterminate
pseudo-class can be used to match against indeterminate progress bars. To change the progress bar to indeterminate after giving it a value you must remove the value attribute with
element.removeAttribute('value')
.
<progress value="70" max="100">70 %</progress>
On Windows 7, the resulting progress looks like this:
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of '<progress>' in that specification. |
实时标准 | |
|
HTML5
The definition of '<progress>' in that specification. |
推荐 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
progress
|
Chrome 完整支持 6 | Edge 完整支持 12 |
Firefox
完整支持
6
注意事项
|
IE 完整支持 10 | Opera 完整支持 11 | Safari 完整支持 6 | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes |
Firefox Android
完整支持
6
注意事项
|
Opera Android 完整支持 11 |
Safari iOS
完整支持
7
注意事项
|
Samsung Internet Android 完整支持 Yes |
max
|
Chrome 完整支持 6 | Edge 完整支持 12 | Firefox 完整支持 6 | IE 完整支持 10 | Opera 完整支持 11 | Safari 完整支持 6 | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 6 | Opera Android 完整支持 11 | Safari iOS 完整支持 7 | Samsung Internet Android 完整支持 Yes |
value
|
Chrome 完整支持 6 | Edge 完整支持 12 | Firefox 完整支持 6 | IE 完整支持 10 | Opera 完整支持 11 | Safari 完整支持 6 | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 6 | Opera Android 完整支持 11 | Safari iOS 完整支持 7 | Samsung Internet Android 完整支持 Yes |
完整支持
见实现注意事项。
<meter>
:indeterminate
-moz-orient
::-moz-progress-bar
::-ms-fill
::-webkit-progress-bar
::-webkit-progress-value
::-webkit-progress-inner-element
<button>
<datalist>
<fieldset>
<form>
<input>
<label>
<legend>
<meter>
<optgroup>
<option>
<output>
<progress>
<select>
<textarea>