List tags in HTML 5
List tags are used for specifying ordered , unordered lists, terms and their definitions.
- <li>:- We use this tag to indicate that a list will be used in this tag. List will contain list item. Its contents can be value which will be number from where we want to start like 5. Its not mandatory to give number. We can simply write list item.
Syntax:
<li> Item we want to give in list. </li>
Code:
<!DOCTYPE HTML>
<html>
<body>
<ol>
<li> list </li>
<li> item </li>
</ol>
</body>
</html>
Output:
- <ol>:- We use this tag to indicate that we are going to start an ordered list.
Attributes:
a) start :- We can use start attribute with tag to specify the number from where list items will be
started.
b) reversed :-We can use this attribute to specify the descending number from where the list will
be started and then continue.
Syntax:
<ol start ="Number from where you want to start your list items">
<li> Item we want to give in list. </li>
</ol>
Code:
<!DOCTYPE HTML>
<html>
<body>
<ol start="5">
<li> I m list tag </li>
<li> I m ol tag </li>
</ol>
</body>
</html>
Output: