HTML li Tag

HTML<li>Tag: The HTML<li>tag specifies a menu list. This HTML li tag is used ordered, unordered and in menu lists. And also the <li> tag requires a starting and end tag. The end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in its parent element.

HTML<li>Tag

Attribute Value: The <li> tag contains two attributes type and value.

Syntax: <li>Text</li>

Browser compatibility

The HTML<li> tag is supported by different types of browsers.

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Internet Explorer

Example:

<!DOCTYPE html>
<html>
<body>
<p>Programming Languages</p>
<ol>
  <li>C</li>
  <li>C++</li>
  <li>JAVA</li>
</ol>
<p>Scripting Languages</p>
<ul>
  <li>JAVASCRIPT</li>
  <li>VBSCRIPT</li>  
</ul>
</body>
</html>

Output:

HTML li tag

Attributes that are supported by the <li> tag

Attribute Value Description
type 1
A
a
I
i
disc
square
circle
Specifies which kind of bullet point will be used
value number Specifies the value of a list item. The following list items will increment from that number