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 -

AttributeDescriptionValues
TypeSpecifies what kind of bullet point used.Not supported in HTML51AaIidiscsquarecircle
ValueSpecifies the value of the list itemnumber

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:
  1. Monday
  2. Tuesday
  3. Wednesday
  4. Thursday
  5. Friday
  6. Saturday
  7. Sunday
UnOrdered list:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday