What does the HTML5 meter label mean? HTML5 meter weights and measures how to change the color detail. This article is about the definition and usage of the HTML5 meter label, as well as a detailed description of how HTML5 meter weights change color.
HTML5 definition and usage of meter tags:
<meter> tags define weights and measures. Measures that are used only for the known maximum and minimum values.
such as: disk usage, query results of relevance and so on.
Note: <meter> cannot be used as a progress bar, progress bar <progress> tag.
Here are some examples:
<meter min= "0" max= ">5</meter><meter>2 out" of 10</meter><meter>30%</meter>
What is the meter element:
The meter element represents the quantity value within the specified range. The meter element has 6 properties!
1.value attribute: The actual value that is specifically represented in the element. The property value defaults to 0, and you can set a floating point decimal value for the property.
2.min Properties: Specifies the minimum allowable value for the specified range, default 0, the value set when setting this property cannot be less than 0.
3.max Properties: Specifies the maximum value that is allowed when the specified range is set, or the value of the Min property as the maximum value if the value of the property is less than min at the time of setting. The default value for the Max property is 1.
4.low attribute: The lower value of the specified range, which must be less than or equal to the high value.
5.high attribute: The upper value of the specified range. If the value of the property is less than the value of the low property, the value of the low property is treated as the value of the high property, and if the value of the property is greater than the value of the Max property, the value of the Max property is treated as a value of high.
6.optimum Properties: The best value attribute value must be between the Min attribute value and the Max property value, which can be greater than the high property value.
HTML5 meter weights and measures how to change colors:
To change the color in meter, you need to use five values: min (minimum), Max (max), low, high, value, and Optimum, where the first four values divide the entire progress into 3 intervals.
Green: When value and optimum values are in an interval, it will appear green.
Yellow: When the optimum between high and max, value is between low and high, it will show a yellow
When the optimum is between low and high, the value is between min and low, and it appears yellow between high and max.
When the optimum between Min and low, the value values appear yellow between low and high.
Red: When the optimum is between high and max, the value values appear red between min and low.
When the optimum between min and low, value will appear red between high and Max.
When the optimum is in the green area, the value is also in the green area, the whole will show the green
When the optimum is in the green area, the value is in the yellow area and the whole is yellow.
When the optimum is in the green area, the value is in the red area and the whole is red.
When the optimum is in the green area, the Valu value is green in the middle green area.
When the optimum is in the green area, the value values appear yellow between min and low and between high and Max
When the optimum is in the green area, the value is also in the green area, the whole will show the green
When the optimum is in the green area, the value is in the yellow area and the whole is yellow.
When the optimum is in the green area, the value is in the red area and the whole is red.
The difference between HTML 4.01 and HTML 5:
The <meter> tag is a new label in HTML 5.
"Recommended"
What are the specific uses of HTML <fieldset> tags? How do I set the border color with fieldset?
What are the attributes of html<option>? An introduction to the specific use of the option selected property