HTML <li> Tag
Description
The <li>
HTML tag, short for "list item," is used to define an item in a list. It is typically used within ordered lists <ol>
or unordered lists <ul>
. Each <li>
element represents a single item within the list, and the content inside the <li>
tags can include text, images, links, or other HTML elements. When rendered in a web browser, list items are typically displayed with a bullet point (for unordered lists) or a sequential number or letter (for ordered lists) to indicate their position within the list. The <li>
tag is a fundamental element for structuring and presenting information in a list format on web pages.
Properties
- Permitted Parents
- An <ul>, <ol>, or <menu> element. Though not a conforming usage, the obsolete <dir> can also be a parent
- Content
- Block, inline and text
- Start/End Tags
- Start tag: required, End tag: required
Example
<ul>
<li>Mouse</li>
<li>Cat</li>
<li>Dog</li>
</ul>
Attributes
Attribute | Definition |
---|---|
type |
Specifies the type of bullet. Possible values:
|
value | Specifies the number of the current list item. -Deprecated- |
Global Attributes
The <li>
tag also supports the Global Attributes in HTML5
Event Attributes
The <li>
tag also supports the Event Attributes in HTML5
Browser Support
The following table will show you the current browser support for the HTML <li>
tag.
Desktop | |||||
12 | 1 | 1 | 12.1 | 3 |
Tablets / Mobile | |||||
18 | 4 | 12.1 | 1 | 1 | 4.4 |
Last updated by CSSPortal on: 30th March 2024