HTML <li> tag
The <li> tag defines the list of items in Ordered List & Unordered List.
- Ordered List is denoted by <ol>
- Unordered List is denoted by <ul>
Syntax:
<li>text..</li>
Example
<ol> <li>Brahmaputra River</li> <li>Narmada River</li> <li>Godavari River</li> <li>Yamuna River</li> <li>Mahanadi River</li> <li>Tapti River</li> </ol>
Default CSS Value
display: list-item;
How Browser will display
BLOCK Level.
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
HTML4 does not support the value attribute. | No difference compared to HTML4 | HTML5 does not support the type attribute but supports the value attribute. |
Attributes used with <li> tag
Attribute | Description |
---|---|
value | Sets the initial value of the list item and it will keep incrementing the value for next items. |
type | This shows the type of list. It can take the followging values - |
Note/Info To create beautiful lists, you should use CSS Lists.
Global Attributes
The <li> tag supports Global attributes.
Event Attributes
The <li> tag supports Event attributes.
Supporting Browsers
Related Tags
<ol> , <ul> , <menu> , <dir> .
HTML5 does not even support the <menu> tags.