- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <meter> Tag
The HTML <meter> tag represents either a scalar value within a known range or a fractional value. This is also known as gauge.
Following is the attribute of the <meter>tag −
S.No. | Attribute & Description |
---|---|
1 | value It is a mandatory attribute that is used to specify a value in numbers. The number may be an integer or floating-point number. |
2 | form Specifies the one or more forms to which the meter element belongs. |
3 | high Specifies the range that is considered to have a high value. |
4 | low Specifies the range that is considered to be a low value. |
5 | max Specifies the maximum value of the range. |
6 | min Specifies the minimum value of the range. The default value is 0. |
7 | Optimum It is an optional attribute that is used to specifies the optimum value for the gauge. |
Syntax
Following is the syntax of <meter> tag −
<meter id=" " min=" " max=" " low=" " high=" " value=" "> …content </meter>
Example
In the following example, we are creating an HTML document and mapping the fuel level with the help of the <meter> tag, as follows −
<!DOCTYPE html> <html> <head> <style> label { padding-right: 10px; font-size: 1rem; } </style> </head> <body> <label for="fuel">Fuel level:</label> <meter id="fuel" min="0" max="100" low="35" high="70" optimum="80" value="50"> at 100/100 </meter> </body> </html>
When we run the above code, it will generate an output displaying the fuel level on the webpage.
Example
Considering the following example, we are displaying a scalar value within a given range for the disc usage, as follows −
<!DOCTYPE html> <html> <body> <h1>The meter element</h1> <label for="disk_c">Disk usage C:</label> <meter id="disk_c" value="5" min="0" max="10">2 out of 10</meter> <br> <label for="disk_d">Disk usage D:</label> <meter id="disk_d" value="0.8">100%</meter> </body> </html>
On running th above code, the output window will pop up displaying the space consumed by the disc on the webpage.
html_tags_reference.htm
Advertisements