HTML <li> Tag
The HTML <li>
tag defines a list item and is used within an ordered or unordered list <ol>
or <ul>
.
Syntax
<ol>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
The HTML <li>
tag defines a list item and is used within an ordered or unordered list <ol>
or <ul>
.
<ol>
<li>...</li>
<li>...</li>
<li>...</li>
</ol>
<ul>
<li>...</li>
<li>...</li>
<li>...</li>
</ul>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Cherry</li>
</ul>
The HTML <li>
tag is used to create a list item within an ordered <ol>
or unordered <ul>
list. It is a block-level element, meaning it takes up the entire width of its container.
Each item must be wrapped with the <li>
tag. The ordered list will automatically increment numbers, while an unordered list will use bullets by default.
The HTML <li>
tag is used for creating lists of items. Using ordered lists (<ol>
) allows you to display items in a numbered format, while unordered lists (<ul>
) display items with bullet points.
This <li>
tag is used in combination with <ul>
and <ol>
tags.
<li>
tag must be used within an ordered or unordered list (<ol>
or <ul>
).<li>
tag.<li>
tag is used to define a list item.The HTML <li>
tag is used to create a list item within an ordered or unordered list (<ol>
or <ul>
). Each list item should be enclosed within an <li>
tag. This tag is used in combination with the <ul>
and <ol>
tags.