我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

Introduced in HTML5

The HTML <progress> element represents the completion progress of a task, typically displayed as a progress bar.

Content categories Flow content, phrasing content, labelable content, palpable content.
Permitted content Phrasing 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 phrasing content.
Permitted ARIA roles None
DOM interface HTMLProgressElement

Attributes

This element includes the global attributes.

max
This attribute describes how much work the task indicated by the progress element requires. The max attribute, if present, must have a value greater than zero and be a valid floating point number. The default value is 1.
value
This attribute specifies how much of the task that has been completed. It must be a valid floating point number between 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.

NOTE: The minimum value is always 0 and the min attribute is not allowed for the progress element. You can use the -moz-orient CSS property to specify whether the progress bar should be rendered horizontally (the default) or vertically.

NOTE: The :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")

Examples

<progress value="70" max="100">70 %</progress>

Result

On Windows 7, the resulting progress looks like this:

progress-firefox.JPG

Additional examples

See -moz-orient.

Specifications

Specification Status Comment
HTML Living Standard
The definition of '<progress>' in that specification.
Living Standard  
HTML5
The definition of '<progress>' in that specification.
Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support6 Yes61 210116
max6 Yes610116
value6 Yes610116
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic support Yes Yes Yes61 2 No1173
max Yes Yes Yes6 No117
value Yes Yes Yes6 No117

1. Prior to Firefox 14, the <progress> element was incorrectly classified as a form element, and therefore had a form attribute. This has been fixed.

2. Firefox provides the ::-moz-progress-bar pseudo-element, which lets you style the part of the interior of the progress bar representing the amount of work completed so far.

3. Safari on iOS does not support indeterminate progress bars (they are rendered like 0%-completed progress bars).

See also