HTML - Li element (list item)

About

li 1) is an element that represents a single item in a.

Example

This example shows a ordered list

<ol> 
    <li>First Element</li> <!-- li = list item -->
    <li>Second Element</li>
    <li>Third Element</li>
</ol>

Selection

If you want to select a li list item, you need to use a child pseudo-selector

This example shows the painting in blue of the second list item

  • The selection of the second li child of ol
ol > li:nth-child(2){
  color: blue;
}
  • The html
<ol> 
    <li>First Element</li> 
    <li>Second Element</li>
    <li>Third Element</li>
</ol>
  • Output:

Formatting

See CSS - list-item (list formatting)

ARIA Role

ARIA list item role





Discover More
CSS - list-item (list formatting)

This page is the formatting of element seen as a list-item. A list-item has: a principal block box (the normal box) and anadditional box known as themarker box (the marker). All properties applies...
HTML - List

A group of non-interactive list items. A list can contain: listitem, or another list HTML Unordered list: HTML ul: (Tree|Nested) Unordered list Ordered list: HTML ol element Description...
HTML - OL element (ordered list)

ol is a element that represents an ordered list. Ordered and unordered lists are rendered in an identical manner except that visual user agents number ordered list items. In ordered lists, it is not...
HTML - UL element (unordered list)

ul is an element that represents an ordered list. The difference with an ordered list is just the numeration of the list item. Unordered list items are not numbered. menu
DOM - Selection of Node Element (querySelector)

This page shows you how to select node elemenst in the DOM tree This section shows you how to returns the first element within the document of a selection. In the below code: selector is a selector...
Chrome Devtool Selector
Selector - Child Selector

A child selector is a selector that select child element in the DOM childdescendantdescendant selector A child selector matches when an element is the child of some element. A child selector is made...



Share this page:
Follow us:
Task Runner