HTML5的“进展”的良好用法或“米”? [英] A good usage of HTML5's "progress" or "meter"?

查看:123
本文介绍了HTML5的“进展”的良好用法或“米”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有10页的调查(每页一个问题)。在每个页面的顶部,您包含文本问题2 of 10。对于进展来说,这是一个很好的选择吗? a>或计量表

Say you have a survey with 10 pages (one question per page). At the top of each page, you include the text, "Question 2 of 10". Is this kind of a thing a good candidate for "progress" or "meter"?

从语义上讲,进步最初似乎是最合适的。但是,我阅读和看看的例子越多,我认为米可能更合适。

Semantically speaking, "progress" initially seems like the best fit. But, the more I read and look at examples, I think "meter" may be more appropriate.

<meter max="10" value="1">Question 1 of 10</meter>
<progress max="10" value="1">Question 1 of 10</progress>

推荐答案

语义上说来,进度似乎在这里使用是正确的。我还向 HTML5 Doctor 提出了问题,他们似乎也同意这一点。我的问题是进度 支持得很差目前全面(7/5/11)。这使得它在今天的实际使用案例中非常难以使用。

Semantically speaking, progress does appear to be the right thing to use here. I also posed the question to HTML5 Doctor, and they seemed to agree with that as well. My problem is that progress is very poorly supported across the board at the moment (7/5/11). This make it very hard to use in a practical use case today.

作为止损,我打算使用新元素名称作为标准div元素中的类名的约定(AKA - 语义类名) 。有关这个想法的更多详细信息: http:/ /jontangerine.com/log/2008/03/preparing-for-html5-with-semantic-class-names

As a stop gap, I am planning to use the convention of using the new element name as a class name in a standard div element (A.K.A. - A semantic class name). For more details, on this idea: http://jontangerine.com/log/2008/03/preparing-for-html5-with-semantic-class-names

这是我的代码看起来像什么今天。在另一年或两年内,当这个元素有更好的支持时,我会回去用真正的 progress 标签替换它。

Here's what my code will look like today. In another year or two, when this element has better support, I'll go back and replace this with real progress tags.

<div class="progress" role="progressbar" aria-valuenow="1" aria-valuemin="1" aria-valuemax="10">
    Question 1 of 10
</div>

这篇关于HTML5的“进展”的良好用法或“米”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆