No, the <li>
(list item) element must be nested within <ul>
(unordered list) or <ol>
(ordered list) tags to be valid in HTML.
Key takeaways:
Unordered lists (UL) display items in a non-sequential format, using bullets like dots or discs. They are ideal for content where order doesn’t matter, such as feature lists or bullet points in articles.
Ordered lists (OL) display items in a sequential, numbered format. They are used when the order is important, such as in recipe instructions or step-by-step tutorials.
Unordered lists use the
<ul>
tag, while ordered lists use the<ol>
tag.Unordered lists use bullets, while ordered lists use numbers or letters to indicate sequence.
Hypertext Markup Language (HTML) is the backbone of the World Wide Web (WWW), and it is the standard markup language for creating web pages. Lists are a fundamental element in web design, and HTML offers two primary list types:
Unordered lists
Ordered lists
Unordered lists, represented in HTML by the <ul>
tag. It is used to display a list of items in a non-sequential, unnumbered format. Bullets, typically dots or discs, are commonly used to mark each item in the list. Unordered lists are ideal for presenting sets of items where the order is not important, and each item carries equal weight.
Feature lists: Unordered lists are suitable for showcasing a product or service’s features or benefits. For instance, a software product’s website may list its key features as an unordered list, with each feature having equal importance.
Bullet points in articles: In articles or blog posts, unordered lists are commonly used to present information in a scannable, easy-to-read format. This can include listing key points, tips, or any content that doesn’t rely on a specific order.
Ordered lists, represented in HTML by the <ol>
tag. It is used to display a list of items in a sequential, numbered format.
Recipe instructions: When presenting a set of instructions in a recipe, the order of the steps is crucial to the outcome of the dish. An ordered list ensures that the user follows the steps in the correct sequence
Tutorials or guides: Ordered lists are the preferred choice for step-by-step tutorials or guides. Whether assembling furniture, setting up software, or any process that requires a specific order, an ordered list ensures clarity and completeness.
Here is a summarized comparison of the unordered and ordered lists:
Feature | Unordered Lists (UL) | Ordered Lists (OL) |
HTML tag |
|
|
Purpose | To display items in a non-sequential format | To display items in a sequential, numbered format |
Markers | Typically uses bullets (e.g., dots, discs) | Uses numbers or letters (e.g., 1, 2, 3; A, B, C) |
Importance of Order | Order of items is not important | Order of items is important |
Use Cases | - Feature lists - Bullet points in articles | - Recipe instructions - Tutorials or guides |
Haven’t found what you were looking for? Contact Us
Free Resources