•List items are container tags.
•A list consists of list items <li>
•There are 2 types of lists
1.Ordered lists <ol> -
~These show with numbers.
~You can use these when the points have a certain order.
For example👇🏻
<ol>
<li> Coffee </li>
<li> Tea </li>
<li> Milk </li>;
</ol>
Output👇🏻
- Coffee
- Tea
- Milk
2.Unordered lists <ul>
~They are shown with bullet points.
~You can use these when the order of the items is not important
Example 👇🏻
<ul>
<li> Coffee </li>
<li> Tea </li>
<li> Milk </li>;
</ul>
Output
•Coffee
•Tea
• Milk
•A list can contain any number of items
• A list can be nested inside another
• (use indentation to make your code look clean when you prefer nesting)
<ul>
<li>Coffee</li>
<li>Tea (Varieties)
*<ul>
<li>Green Tea</li>
<li>Black Tea</li>
</ul>*
</li>
<li>Milk</li>
</ul>
💡Quick Tip
•Each < li > tags are presented in new lines automatically
Example👇🏻
<ol>
<li>Item1</li><li>Item2</li>
<li>Item3</li>
<\ol>
Output👇🏻
- Item1
- Item2
- Item3
Top comments (0)