As we know in lists are the part of day to day life. In real world we create todo list, name list, dream list, grocery list etc lot of list. So in web list is the basic element of html. By using this we can render element in order or unordered way.
In html we have three type of list –
1. Ordered
2. Unordered
3. Definition
Ordered list
It’s a list of related items where order of item is important and it will render in order way. To create order list we have ol (ordered list) element and for list items we need to use li element.
Ex:-
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
Here we can use type attribute to use different marker like –
Type | Description |
---|---|
type=”1″ | The list items will be numbered with numbers (default) |
type=”A” | The list items will be numbered with uppercase letters |
type=”a” | The list items will be numbered with lowercase letters |
type=”I” | The list items will be numbered with uppercase roman numbers |
Unordered list
It’s just a list of related items whose order dose not matter. To create an unordered list we need to use ul (unordered list) element and for list items we need to use li element.
Ex:-
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
Here we can use type attribute to use different marker like –
Value | Description |
---|---|
disc | Sets the list item marker to a bullet (default) |
circle | Sets the list item marker to a circle |
square | Sets the list item marker to a square |
none | The list items will not be marked |
Description list
This list is a spacial kind of list in witch you can use list of terms with description of each term.
Ex:-
<dl>
<dt>One</dt>
<dd>First number</dd>
<dt>Two</dt>
<dd>Second number</dd>
</dl>