开发者

How to mark up quantity data together with a list element in HTML5?

开发者 https://www.devze.com 2023-02-15 02:23 出处:网络
I have an unordered list of categories to use for navigation. For each category I want to provide information about the number of items in each category, so I get the navigation like this:

I have an unordered list of categories to use for navigation. For each category I want to provide information about the number of items in each category, so I get the navigation like this:

First category      5
Second cat...       2
Next                9
Last category       1

I want this to be marked up in a way like

<nav>
  <u开发者_JAVA百科l>
    <li><a href="1.html">First category</a> <span>5</span></li>
    <li><a href="2.html">Second cat...</a> <span>2</span></li>
    <li><a href="3.html">Next</a> <span>9</span></li>
    <li><a href="4.html">Last category</a> <span>1</span></li>
  </ul>
</nav>

but I would like to know if there is a more semantically specific tag to use for the quantities than <span>?


Not that I'm aware of. The information in this case is purely for the human reader and not for any technology one, so to me span is appropriate, if it's even required at all.

0

精彩评论

暂无评论...
验证码 换一张
取 消