HTML5 – Lists
Lists are used to organize content into a numbered or bullet-pointed format. In HTML5, there are two types of lists: ordered lists and unordered lists.
An ordered list is a list of items that are numbered, such as a list of steps in a recipe. In HTML5, ordered lists are represented by the <ol>
element. Each item in the list is represented by the <li>
element.
Here is an example of an ordered list in HTML5:
<ol>
<li>Preheat the oven to 350°F</li>
<li>Mix the flour, sugar, and baking powder in a bowl</li>
<li>Add the eggs and milk, and mix until well combined</li>
<li>Pour the mixture into a greased baking dish</li>
<li>Bake for 30 minutes, or until a toothpick inserted into the center comes out clean</li>
</ol>
An unordered list is a list of items that are bullet-pointed, such as a list of ingredients in a recipe. In HTML5, unordered lists are represented by the <ul>
element. Each item in the list is still represented by the <li>
element.
Here is an example of an unordered list in HTML5:
<ul>
<li>1 cup flour</li>
<li>1 cup sugar</li>
<li>1 tsp baking powder</li>
<li>2 eggs</li>
<li>1 cup milk</li>
</ul>
You can style lists using CSS, such as by changing the bullet points, numbering style, or indentation. You can also apply CSS classes or IDs to lists to give them specific styles.