What Is The HTML <li> Tag?

What Is The HTML Li Tag

Date First Published: 12th February 2023

Topic: Web Design & Development

Subtopic: Web Development

Article Type: Computer Terms & Definitions

Difficulty: Medium

Difficulty Level: 5/10

Learn more about what the HTML <li> tag is in this article.

In HTML, the <li> tag is used to represent a list item. It must be placed within the parent element <ul>, used to define an unordered list, <ol>, used to define an ordered list, and <menu>, used to define a menu. Each bulleted or numbered entry uses this tag.

Examples Of The <li> Tag

Below are examples of the <li> tag with the output. In order to make these tags clear, they are in bold.

<h2>Ordered List</h2> <ol> <li>Tea</li> <li>Coffee</li> <li>Milk</li> </ol>

Ordered List

  1. Tea
  2. Coffee
  3. Milk
<h2>Unordered List</h2> <ul> <li>Tea</li> <li>Coffee</li> <li>Milk</li> </ul>

Unordered List

  • Tea
  • Coffee
  • Milk

Attributes

The table below shows the attributes for the <li> tag.

Attribute Description
value Specifies the value of a list item within an ordered list.
type Specifies the type of bullet point to be used in an unordered list.


Feedback

  • Is there anything that you disagree with on this page?
  • Are there any spelling, grammatical, or punctuation errors on this page?
  • Are there any broken links or design errors on this page?

If so, it is important that you tell me as soon as possible on this page.