Summary -
In this topic, we described about the <li> tag along with detailed example.
List item in HTML documents. The <li> tag used to represent a list item in HTML document. The <li> tag can used in conjunction with ul(unordered list) or ol(ordered list).
The tag can be specified like <li></li> with the list item in between the opening and closing tags. The <li> tag is a nested tag. <li> tag closing tag is mandatory.
Syntax -
<li>HTML text here </li>
Optional Attributes -
Attribute | Description | Values |
---|---|---|
Type | Specifies what kind of bullet point used.Not supported in HTML5 | 1AaIidiscsquarecircle |
Value | Specifies the value of the list item | number |
Example -
<!DOCTYPE html>
<html>
<head>
<title>LIST tag example.. </title>
</head>
<body>
<h6> Ordered list: </h6>
<ol>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
<li>Saturday</li>
<li>Sunday</li>
</ol>
<h6> UnOrdered list: </h6>
<ul>
<li>Monday</li>
<li>Tuesday</li>
<li>Wednesday</li>
<li>Thursday</li>
<li>Friday</li>
<li>Saturday</li>
<li>Sunday</li>
</ul>
</body>
</html>
Output -
Ordered list:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
UnOrdered list:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday