HTML 5 <meter> 標簽
定義和用法
<meter> 標簽定義度量(單位)。僅用于已知最大和最小值的度量。
HTML 4.01 與 HTML 5 之間的差異
<meter> 標簽是 HTML 5 中的新標簽。
提示和注釋
注釋:必須定義度量的范圍,既可以在 text 中,也可以在 min/max 屬性中定義。
例子
<meter min="0" max="20">5</meter> <meter>2 out of 10</meter> <meter>30%</meter>
屬性
屬性 | 值 | 描述 |
---|---|---|
high | number | 定義度量的值位于哪個點,被界定為高的值。 |
low | number | 定義度量的值位于哪個點,被界定為低的值。 |
max | number | 定義最大值。默認值是 1。 |
min | number | 定義最小值。默認值是 0。 |
optimum | number | 定義什么樣的度量值是最佳的值。如果該值高于 "high" 屬性,則意味著值越高越好。如果該值低于 "low" 屬性的值,則意味著值越低越好。 |
value | number | 定義度量的值。 |
標準屬性
class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title
如需完整的描述,請訪問 HTML 5 中標準屬性。
事件屬性
onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload
如需完整的描述,請訪問 HTML 5 中事件屬性。