HTML <li> (List Item) Tag

❮ Previous Reference Next ❯

Example

<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>

<ol>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ol>

Meaning

The <li> element is used to specifies a list item as contained in an ordered list <ol>, unordered list <ul>, or older list styles such as <dir> and <menu>.

Notes:

Version: HTML 2, 3.2, 4, 4.01, 5


Standard Syntax

<ol>
	<li></li>
</ol>

<ul>
	<li></li>
</ul>



Browser Support




Status







Attributes

Attribute Value Description
value number value attribute specifies the current number of items in an ordered list as defined by an ol element.
type a
A
i
I
1
Deprecated. Specifies the numbering type.



Global Attributes

<li> element also supports the Global Attributes in HTML.


Event Attributes

<li> element also supports the Event Attributes in HTML.




More Examples

Use of the value attribute in an ordered list.

Example

<ol>
  <li value="3">One</li>
  <li>Two</li>
  <li>Three</li>
</ol>



Nested <ol> element:

Example

<ol>
  <li>One</li>
  <ol>
    <li>One.1</li>
    <li>Two.2</li>
  </ol>
  <li>Two</li>
</ol>



Nested <ul> element:

Example

<ul>
  <li>One</li>
  <ul>
    <li>One.1</li>
    <li>Two.2</li>
  </ul>
  <li>Two</li>
</ul>



By Default CSS Value(s)

Most of the browsers will display the <li> element with the following by default value(s)

li {
	display: list-item;
}



❮ Previous Reference Next ❯