html tutorial - max Attribute in HTML - html5 - html code - html form



Max attribute in html

Learn html - html tutorial - Max attribute in html - html examples - html programs

  • The max attribute defines the Maximum value of the element.
  • In the <progress> element, the max attribute defines how much the task requires in total.

Syntax for max attribute in HTML:

<meter max="number">content </meter>

Differences between HTML 4.01 and HTML5 for max attribute:

HTML 4.01

  • The <meter> tag has not been defined.

HTML 5

  • The <meter> tag is unique.

Applies To:

Element Attribute
<meter> max
<input> max
<progress> max

max Attribute Values:

Value Description
number Defines a floating-point number which is treated to be a maximum value.
date Describes the maximum date allowed.

Sample Coding for max Attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy HTML max attribute</title>
    </head>
<body>
       <h2>Wikitechy Learner's Score:</h2>
       HTML-75% <meter value="75" max="100">75 out of 100 </meter>
       <br>
        <br>
        CSS-65% <meter value="65" max="100">65 out of 100</meter>
        <br>
</body>
</html>

Code Explanation for max Attribute in HTML:

max Attribute Code Explanation

  1. <meter> tag is used to display a measurement with a graphical view in a range.
  2. value attribute used to define the value of the <meter>.
  3. max attribute is used to set the maximum value of the meter.

Output for max Attribute in HTML:

max Attribute Tag Output

  1. The meter value is 75 and maximum value is 100, the HTML gauge (HTML-75%) can value of html.

Browser Support for max Attribute in HTML:

element
<input> 5.0 10.0 16.0 5.1 10.6
<meter> 8.0 No 6.0 6.0 11.0
<progress> 8.0 10.0 16.0 6.0 11.0

Tips and Notes

  • The max attribute is used together with the min attribute to create a range of legal values.
  • The max and min attributes works with the following input types: number, range, date, datetime, datetime-local, month, time and week.
  • The max attribute and the min attribute, which defines the full range of the gauge.

Related Searches to max Attribute in html