Why we always use
    to make Navigation why not
      ?

前端 未结 7 1185
北荒
北荒 2020-12-17 11:05

Why do we always use

    to make navigation why not
      ? While we can use both technically.

7条回答
  •  一向
    一向 (楼主)
    2020-12-17 11:32

    I think this is a classic example of why you should separate style from content. As Developer Art, if you don't care about semantic markup, then you can use either one or the other or something completely different at all.

      and
        will be rendered differently as a default, with ordered lists numbered (or with letters) indicating the order and unordered lists with bullets or something similar. However, since I assume that about every web page uses styling, this doesn't necessarily matter.

        I'd use ordered lists when the order is actually important for the content. Table of contents, enumerations, or any lists where the order is important for the content represented are examples. For most everything else I use unordered lists. (So, you could say that I always use unordered lists unless I have a good reason to use an ordered list.)

        Though navigation items do have an order, this is more a visual thing of how navigation is represented and thus can be most easily achieved by using a simple unordered list and appropriate styling. I do not think that navigation items do have an order based on the content. I would argue that although the order is also important for navigation, it's not that important content-wise.

        After all, it's a matter of how you see the content and shouldn't make that much difference when it comes to the actual implementation.

提交回复
热议问题