Categories
HTML Web development

HTML meter tag

HTML meter tag

HTML <meter> tag

The HTML <meter> tag specifies a scalar measurement within a known range or a fractional value.

The HTML <meter> tag is used to display a gauge like disk usage, the relevance of a query result, etc.

Example:

<!DOCTYPE html>
<html>
<body>

<label for="disk_c">Disk usage C:</label>
<meter id="disk_c" value="8" min="0" max="10">8 out of 10</meter><br>

<label for="disk_d">Disk usage D:</label>
<meter id="disk_d" value="0.3">30%</meter>

</body>
</html>

Output:

8 out of 10
30%

Attributes:

form (value- form_id) – defines which form the <meter> element belongs to.

height (value- number) – defines the range that is considered to be a high value.

low (value- number) – defines the range that is considered to be a low value.

max (value- number) – defines the maximum value of the range.

min (value- number) – defines the minimum value of the range.

optimum (value- number) – defines what value is the optimal value for the gauge.

value (value- number) – defines the current value of the gauge.

Note: The HTML <meter> tag shouldn’t be used to indicate progress (as in a progress bar). For progress bars, use the <progress> tag.

Enjoy coding!