Are you making a website and want to demonstrate how much space is left on it or how strong a user’s password is? You might feel tempted to use a standard progress bar, but HTML provides a much better tool for this: the HTML Meter Tag.
What is the HTML Meter Tag?
It defines a scalar measurement within a defined range. Think of it like a gauge on a car dashboard or a battery indicator. You use it to demonstrate where a certain measurement lies between the minimum and maximum values.
Key Characteristics of the Meter Element
-
- Values that don’t change: It works best for values that don’t change all the time, like a test score.
- Not for Progress: Use the element instead if you are showing a file download.
- Visual Feedback: Depending on whether the value is “low,” “high,” or “optimal,” browsers automatically modify how the meter looks.
Essential Attributes of the Meter Tag in HTML
You need to use certain attributes for the Meter Tag to work. These inform the browser how to draw the gauge.
- value: This is the meter’s current number. It is required.
- min: The range’s lower limit. If you don’t set it, the default is 0.
- max: The highest number in the range. The default is 1 if you don’t set it.
- low: The point where the value is considered “low.”
- high: Defines the point where the value is considered “high.”
- optimum: Defines the “perfect” value in the range.
| Attribute | Description | Default Value |
| value | The current measurement | None (Required) |
| min | The start of the range | 0 |
| max | The end of the range | 1 |
| low | The threshold for a low value | min |
| high | The threshold for a high value | max |
| optimum | The ideal value within the range | Midpoint |
Among the 50 tags of HTML, elements like <h1>, <p>, <a>, <img>, <table>, and <form> build the structure of a webpage, while the <meter> tag is specially used to display a value within a fixed range in a visual format.
How to Use the HTML Meter Tag in Code?
It’s easy to write the code for a meter. You place the current value inside the opening and closing tags as a fallback for older browsers.
Example Code:
<meter value=”0.6″>60%</meter>
In this example, the gauge will fill up 60% of the bar because the default max is 1 and the value is 0.6.
Adding Ranges for Better Visuals
You can make the meter more informative by adding “low” and “high” marks. If the value falls below the “low” mark, the browser might change the Meter Tag Color to yellow or red to warn the user.
Styling with Meter Tag CSS
While the browser provides a default look, most developers want to match the meter to their website’s theme. This is where Meter Tag CSS comes into play. You can change the width, height, and even the internal colours of the bar.
Because different browsers (like Chrome and Firefox) handle the meter differently, you often need to use “pseudo-elements” to style it correctly.
Changing the HTML Meter Tag Color
To change the bar’s appearance, you might use:
- meter-inner-element: To style the container.
- meter-bar: To change the background.
- meter-optimum-value: To style the bar when it is in the “good” range.
Where Does HTML Meter Tag Fit in Web Development?
When learning about the 50 tags, the meter tag stands out as a “semantic” tag. Semantic tags help search engines and screen readers understand exactly what the content is. Instead of just using a generic <div> and styling it to look like a bar, using the Meter Tag tells the computer, “This is a measurement.”
Other common structural tags you might learn alongside this include the HR Tag. While the meter shows data, the HR Tag used in HTML is a thematic break used to separate sections of text with a horizontal line. Using both correctly ensures your webpage is both functional and easy to read.
Applications for HTML Meter Tag
Where will you see the Meter Tag in the real world?
- Storage Space: Showing how many gigabytes are left on a cloud drive.
- Poll Results: Displaying the percentage of votes for different candidates.
- Gaming: Showing a player’s experience points or energy levels.
- Password Strength: Giving visual feedback on how secure a password is.
Common Mistakes to Avoid with HTML Meter Tag
- Forgetting the Value: If you don’t include a value attribute, the meter will appear empty.
- Logic Errors: Setting a low value that is higher than the high value will confuse the browser and break the visual logic.
- Ignoring Accessibility: Always provide text inside the tag so that older browsers display something meaningful.
Also Read :
- List of All HTML Tags You’ll Find as a Web Developer!
- HTML References – List, Elements, Attribute
- CSS Units: The Complete Guide For Front End Developers 2025
FAQs
What is the difference between a progress bar and a Meter tag?
The Meter Tag is for a static measurement within a range, like disc space, whereas the progress bar is for an activity that is now going on, like a download.
How do I change the Meter Tag color using CSS?
You can change the bar's internal colours with Meter Tag CSS pseudo-selectors like ::-webkit-meter-optimum-value or ::-moz-meter-bar.
Is the Meter Tag in HTML supported in all browsers?
Yes, most modern browsers can read the Meter tag in HTML. Still, it's a good idea to add content within the element as a backup for really ancient browsers.
Can I use the hr tag used in html inside a meter?
No, the HR tag is used to make horizontal lines between sections, so it can't go inside a meter element.
Why is the Meter Tag important for SEO?
Using the meter tag instead of a generic div is better for semantic HTML. Following a list of the 50 tags makes your site easier to find and index by search engines.
