HTML <meter> max 属性

定义和用法

max 属性规定仪表的上限。

max 属性值必须大于 min 属性值。

如果未指定,则默认值为 1。

提示:max 属性与 min 属性共同定义仪表的完整范围。

实例

仪表具有当前值以及最小、最大、高和低值:

<p><label for="anna">Xiaoming's score:</label>
<meter id="anna" min="0" low="40" high="90" max="100" value="95"></meter></p>
<p><label for="peter">Xiaomei's score:</label>
<meter id="peter" min="0" low="40" high="90" max="100" value="65"></meter></p>
<p><label for="linda">Xiaofeng's score:</label>
<meter id="linda" min="0" low="40" high="90" max="100" value="35"></meter></p>

Try it yourself

Syntax

<meter max="number">

Attribute value

Value Description
number Specifies the floating-point number as the maximum value of the gauge. The default value is "1".

Browser support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
8.0 13.0 16.0 6.0 11.5