A good usage of HTML5's “progress” or “meter”?

前端 未结 7 676
闹比i
闹比i 2021-01-02 02:38

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 fo

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-02 03:10

    According to the latest HTML5 working draft, the progress tag is best used to display the progress of a specific task at hand. meter is best used for task-unrelated guages, such as disk space or memory usage.

    The progress element represents the completion progress of a task.

    Whereas

    The meter element represents a scalar measurement within a known range, or a fractional value; for example disk usage, the relevance of a query result, or the fraction of a voting population to have selected a particular candidate.

    Edit - as rendering and styling seems to be an issue, you might have more luck using other tags. For example a sexy progress navigator could be coded with:

    
    

    And styled with something like this.

提交回复
热议问题