#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
4 min read
•Question 36 of 49easy

What is the Meter Element?

Displaying scalar measurements.

What You'll Learn

  • Using the meter element
  • Threshold attributes
  • Styling meters

The Meter Element

The <meter> element represents a scalar measurement within a known range - like disk usage, test scores, or relevance. It's NOT for progress (use <progress> for that).

Key Attributes

AttributePurpose
minMinimum value
maxMaximum value
valueCurrent value
lowLow threshold
highHigh threshold
optimumOptimal value

Basic Examples

index.htmlHTML
<!-- Basic meter -->
<label for="fuel">Fuel level:</label>
<meter id="fuel" min="0" max="100" value="75">75%</meter>

<!-- With thresholds -->
<label for="score">Test score:</label>
<meter id="score"
       min="0" max="100"
       low="33" high="66" optimum="100"
       value="85">85/100</meter>

<!-- Disk usage (low is good) -->
<label for="disk">Disk usage:</label>
<meter id="disk"
       min="0" max="100"
       low="30" high="70" optimum="0"
       value="45">45%</meter>

Browser Coloring

Browsers color the meter based on whether value is in optimal, suboptimal, or bad range relative to low/high/optimum.