Lists
Lists are used to group related items in a structured manner. HTML offers two primary types of lists: unordered lists and ordered lists.
Unordered List
Used for items that do not follow a specific order. Created using the <ul>
tag with <li>
(list item) elements.
1<ul>2 <li>Apple</li>3 <li>Banana</li>4 <li>Cherry</li>5</ul>
Ordered List
Used for items that follow a specific sequence. Created using the <ol>
tag with <li>
elements.
1<ol>2 <li>Step 1: Gather Ingredients</li>3 <li>Step 2: Mix Ingredients</li>4 <li>Step 3: Bake</li>5</ol>
Nested Lists
You can create nested lists by placing a <ul>
or <ol>
inside a <li>
.
1<ul>2 <li>3 Fruit4 <ul>5 <li>Apple</li>6 <li>Banana</li>7 </ul>8 </li>9 <li>10 Vegetables11 <ol>12 <li>Carrot</li>13 <li>Broccoli</li>14 </ol>15 </li>16</ul>
Comments
You must be logged in to comment.
Loading comments...