There are three methods of creating lists in HTML: ordered (numbered), unordered (bullets) and definition lists (dictionary style). Each one is also customizable . You can use numbers, roman numerals, bullet points or even images for the list.
Also each line within the list (i.e list item) must contain a <li> tag.
<ol> <li>Potatoes</li> <li>Prime Rib</li> <li>Soda</li> </ol>
Outputs:
- Potatoes
- Prime Rib
- Soda
You can also change what the first number will start at by using the 'start' attribute:
<ol start="3"> <li>Potatoes</li> <li>Prime Rib</li> <li>Soda</li> </ol>
Outputs:
- Potatoes
- Prime Rib
- Soda
<ul> <li>Dogs</li> <li>Cats</li> <li>Snakes</li> </ul>
Outputs:
Note: You can also change unordered list types by using the "list-style-type" property in CSS.
Definition lists allow you to create lists in the same way as dictionaries create definitions for words. They work differently from the list above and definition lists use their own tags.
<dl> <dt>Sushi</dt> <dd>Raw fish over rice<dd> <dt>Sashimi<dt> <dd>Thinly sliced raw fish<dd> </dl>
Outputs:
Comments
Post new comment