Contenu du cours
HTML for Beginners
HTML for Beginners
Lists
There are three types of lists in HTML:
- Unordered lists;
- Ordered lists;
- Descriptive lists.
Ordered list
Ordered lists are created with the <ol>
tags. You use <li>
tags to add items to an ordered list. These <li>
tags should come between the opening <ol>
tag and the closing <ol>
tag.
index.html
As you can see browser will render the output with numbers before listing items. However, if you want to use letters instead of numbers, you can use the type attribute of the <ol>
tag.
index.html
Similarly, you can assign "a"
and "i"
to type attributes to get small letters or roman numbers before the list items.
Unordered list
Unordered lists are created the same way ordered lists are created. However, instead of <ol>
tags, you use <ul>
tags.
index.html
A mix of Ordered Lists and Unordered lists
You can mix ordered lists and unordered lists.
index.html
So as you can see, we can use ordered lists under unordered lists.
Descriptive lists
Sometimes we want to create a list of items with descriptions for each item. We use the <dl>
tag along with <dt>
and <dd>
tags to create a list.
index.html
Here <dl>
tag initiates a descriptive list. Then <dt>
tag defines the term of the list item. Finally, the <dd>
tag describes the term.
1. Which of the following tag is used to create an unordered list?
2. Which of the following attributes can be used with tags?
Merci pour vos commentaires !