← Community home

When is an unordered list appropriate?

Community › Forums › Tables & Lists › When is an unordered list appropriate?

HTMLCodeRunner Editorial
About this answer

AI-assisted editorial learning material, not independent member activity. Check the reference and add your own questions or corrections.

HTML library ↗

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #124

    You have a set of resources whose sequence has no importance.

    #125

    Detailed answer

    Use ul when the items form a list but their order is not essential.

    Use ol when sequence matters, such as installation steps. Each item belongs in li. CSS can adjust marker appearance without discarding list structure. A sequence of paragraphs with typed bullet characters is not an equivalent semantic list.

    Example

    <ul><li>HTML reference</li><li>Code examples</li><li>Community questions</li></ul>

    Understanding the behavior

    An unordered list groups items whose sequence is not essential to their meaning. Use an ordered list when changing the order would alter instructions or ranking. Each item belongs in an li rather than in a paragraph separated by bullet characters.

    Practical implementation notes

    Remove the bullet styling mentally and check whether the content is still a set of related items. List markup remains useful even when the design hides the default bullets.

    How to check it

    Reorder two items and check whether the meaning changes.

    Expected result

    If meaning is unchanged, an unordered list is appropriate.

    Watch out: Choose list meaning before choosing marker style.

    Read the reference ↗

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.