when to use UL or OL in html?

前端 未结 12 1997
陌清茗
陌清茗 2020-12-05 03:58

Seems interchangable?

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 04:22

    As the question asks "when to use them", I thought appropriate to offer examples of when, I usually decide to use OL when I want a series of steps, and UL when I want to offer choices:

    Ordered list

    Here the steps are critical for the business case, we must do the steps in this order, therefore an ordered list is used.

    Checkout stages on eCommerce, these steps will be in this order.

    1. shipping
    2. billing
    3. summary
    4. confirmation

    Unordered list

    A user may decide on the order they choose to interact with these choices

    • Contact Us
    • Newsletter Signup
    • Terms
    • Log out

提交回复
热议问题