Conteúdo do Curso
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
index
index
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
index
index
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
index
index
A mix of Ordered Lists and Unordered lists
You can mix ordered lists and unordered lists.
index
index
index
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
index
index
Here <dl>
tag initiates a descriptive list. Then <dt>
tag defines the term of the list item. Finally, the <dd>
tag describes the term.
Obrigado pelo seu feedback!