DEV Community

Cover image for Why unordered list is used to create navigation on the website not an ordered list?
Gaurav Singh
Gaurav Singh

Posted on

Why unordered list is used to create navigation on the website not an ordered list?

We don't need to follow any order while creating the navigation that's why we use an unordered list instead of an ordered list while creating links in Navigation.

Ordered List (<ol>)

  1. An ordered list is used when you want to display a list of items in a specific numerical or alphabetical order.

  2. It is created using the <ol> (ordered list) element and contains list items as <li> (list item) elements.

  3. By default, ordered lists use numbers (1, 2, 3, etc.) to indicate the order, but you can customize the numbering style using CSS.

Unordered List (<ul>)

  • An unordered list is used when you want to display a list of items without any specific order or hierarchy. It is often used for creating bulleted lists.

  • It is created using the <ul> (unordered list) element and contains list items as <li> elements.

  • By default, unordered lists use bullet points (•) to indicate list items, but you can customize the bullet style using CSS.

The choice between ordered and unordered lists should be based on the content and the desired presentation of that content on your web page.

I am a Web Developer & enjoy working on challenging projects, which is what makes this job so rewarding. You can reach out to my My Portfolio Site. I hope this article will helpful

Top comments (0)