HTML Tag Reference - HTML tag <li>








This <li> element creates one item in an ordered list, <ol>, or unordered list, <ul>.

Browser compatibility

<li> Yes Yes Yes Yes Yes

What's new in HTML5

The "type" attribute is deprecated in HTML5.

Attribute

Attribute Value Description
type 1
A
a
I
i
disc
square
circle
Not supported in HTML5.
bullet point type
value number Set the value of a list item. The following list items will increment from that number (valid for <ol> lists)




Global Attributes

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

Event Attributes

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

Default CSS Settings

li {
    display: list-item;
}

Example

A demo showing how to use <li> tag.

<html>
<body>
     <ul>
          <li>first item</li>
          <li>second item</li>
          <li>third item</li>
          <li>fourth item</li>
          <li>fifth item</li>
     </ul><!-- w  ww  .  j av a2  s.c  o m-->
</body>
</html>

Click to view the demo