The HTML <meter> element represents a value within a specified range. This value can be any real number.
Overview TableThe meter element defines a value between a minimum or maximum. This can be used for fundraisers, test results, or a number of other things. It should not be used as a progress bar. For that, use the [progress element](/html/elements/progress). You should give a description of the meter within the tags, such as `
5 out of 10 squares occupied`. This meter can also have various attributes on it, such as the optimum, high and low values.
The content of the meter element should represent the set min/max/value attributes in human readable form. This will be picked up by assistive technologies as well as act as a fallback for browsers not supporting the element.
AttributesThis element supports the HTML5 global attributes.
A basic example of the meter element
<meter min="0" max="10" value="5">5 out of 10</meter>
An example of the meter element using all of its attributes
<meter min="0" max="1000" value="500" low="200" high="800" optimum="900">$500 raised</meter>
Styling options for the meter bar
meter {
-webkit-appearance: none;
}
meter::-webkit-meter-bar {
border: 2px solid black;
}
meter::-webkit-meter-bar {
background: lightblue;
}
meter::-webkit-meter-optimum-value {
background: green;
}
meter::-webkit-meter-suboptimum-value {
background: orange;
}
meter::-webkit-meter-even-less-good-value {
background: red;
}
Usage
The meter element is intended to have descriptive text inside of it, similar to the alt tag of the image element.
The title attribute may be used to specify a unit.
Related specificationsMozilla Developer Network : Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4