Search w3schools.com:

SHARE THIS PAGE

HTML <li> Tag


Example

One ordered (<ol>) and one unordered (<ul>) HTML list:

<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>

<ul>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ul>

Try it yourself »
(more examples at the bottom of this page)

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <li> tag is supported in all major browsers.


Definition and Usage

The <li> tag defines a list item.

The <li> tag is used in ordered lists(<ol>), unordered lists (<ul>), and in menu lists (<menu>).


Differences Between HTML 4.01 and HTML5

The "type" attribute was deprecated in HTML 4.01, and is NOT supported in HTML5.

The "value" attribute was deprecated in HTML 4.01, but IS supported in HTML5.


Tips and Notes

Tip: Use CSS to define the type of list.


Attributes

Attribute Value Description
type 1
A
a
I
i
disc
square
circle
Not supported in HTML5. Deprecated in HTML 4.01. 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 (only for <ol> lists)


Global Attributes

The <li> tag also supports the Global Attributes in HTML.


Event Attributes

The <li> tag also supports the Event Attributes in HTML.


Examples

Try it Yourself - Examples

A nested list
A list inside a list.

Another nested list
A more complicated nested list.


Related Pages

HTML tutorial: HTML Lists



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]