The list-item keyword causes the element to generate a ::marker pseudo-element with the content specified by its list-style properties (for example a bullet point) together with a principal box of the specified type for its own contents.
Syntax
A single value of list-item will cause the element to behave like a list item. This can be used together with list-style-type and list-style-position.
list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords.
Note: In browsers that support the two-value syntax, if no inner value is specified it will default to flow. If no outer value is specified, the principal box will have an outer display type of block.
Examples
HTML
<div class="fake-list">I will display as a list item</div>
CSS
.fake-list {
display: list-item;
list-style-position: inside;
}
Result
Specifications
| Specification | Status |
|---|---|
| CSS Display Module Level 3The definition of 'display-listitem' in that specification. | Candidate Recommendation |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Support of list-item
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
list-item
|
Chrome
Full support 1 |
Edge
Full support 12 |
Firefox
Full support 1 |
IE
Full support 6 |
Opera
Full support 7 |
Safari
Full support 1 |
WebView Android
Full support ≤37 |
Chrome Android
Full support 18 |
Firefox Android
Full support 4 |
Opera Android
Full support 14 |
Safari iOS
Full support 1 |
Samsung Internet Android
Full support 1.0 |
Supported on <legend>
|
Chrome
Full support 71 |
Edge
Full support 79 |
Firefox
Full support 64 |
IE
No support No |
Opera
Full support 58 |
Safari
No support No |
WebView Android
Full support 71 |
Chrome Android
Full support 71 |
Firefox Android
Full support 64 |
Opera Android
Full support 50 |
Safari iOS
No support No |
Samsung Internet Android
Full support 10.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
<display-listitem> by Mozilla Contributors is licensed under CC-BY-SA 2.5.