There are various types of list. some are below as shown in example
- unordered List – An unordered list starts with the <ul> tag. Every list item starts with the <li> tag. The list items will be marked with bullets by default.
- ordered List -An ordered list starts with the <ol> tag. Every list item starts with the <li> tag.
The list items will be marked with numbers by default.
- Description List – A description list is a list with a description of each item.
The <dl> tag defines the description list, the <dt> tag defines the item, and the <dd> tag describes each term.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<!DOCTYPE html> <html> <head> <title>My Page Title</title> </head> <body> <h2>An Unordered HTML List</h2> <ul> <li>Apple</li> <li>Orange</li> <li>Banana</li> </ul> <h2>An Ordered HTML List</h2> <ol> <li>Apple</li> <li>Orange</li> <li>Banana</li> </ol> <h2>Description HTML List</h2> <dl> <dt>Apple</dt> <dd>- red in color</dd> <dt>Banana</dt> <dd>- yellow in color</dd> </dl> </body> </html> |