li

< html‎ | elements
Jump to: navigation, search

li – list item

This article is In Progress.



Summary

The li element represents one list item.


Overview Table

DOM Interface HTMLLIElement


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes

Examples

This example uses the li element to create individual items in an unordered list.

HTML

<ul>
     <li>Art</li>
     <li>History</li>
     <li>Literature</li>
     <li>Sports</li>
     <li>Entertainment</li>
     <li>Science</li>
</ul>

This example uses the li element to create individual items in an ordered list.

HTML

<ol>
     <li>First</li>
     <li>Second</li>
     <li>Third</li>
</ol>

Typical browser default CSS properties for the li element.

CSS

display: list-item;
margin-left: 40px;

Notes

Remarks

The type attribute values disc, circle, and square apply to unordered lists; the values 1, a, A, i, and I apply to ordered lists. When the li element is absolutely positioned with CSS, the list item marker is not rendered. The default value of the display property for this element is list-item.

Standards information

Related specifications

Specification Status Related Changes
HTML5 Specification W3C Candidate Recommendation

See also

Other articles

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]