The <li> (list item) tag in HTML has the following attributes: value: specifies a numeric value (ordered list) or leaves it blank (unordered list); type: specifies the tag type (number, letter) , circle, square); start: specify the value of the first list item (ordered list); reversed: reversely arrange the list items; id: specify a unique ID; class: add a CSS class; title: add a mouseover prompt tool.
Attributes of the HTML li tag
<li>
in HTML (list Item) tag is used to create list items in an unordered or ordered list. It has several properties available:
1. value
<li>Description: Specifies the numeric value of the list item.
<li>Value: an integer (for an ordered list) or empty (for an unordered list).
2. type
<li>Description: Specifies the type of list mark.
<li>
Value:
<li>"1": numeric mark (ordered list)
<li>"a": lowercase letter mark (ordered list)
<li>"A": Uppercase letter mark (ordered list)
<li>"disc": Circle mark (unordered list)
<li>"circle": Hollow circle mark (Unordered list)
<li>"square": Square mark (Unordered list)
3. start
<li>Description: Specify the value of the first list item in the list (ordered list).
<li>Value: an integer.
4. reversed
<li>Description: Arrange list items in reverse order.
<li>Value: Boolean value (true/false).
5. id
<li>Description: Specify a unique ID for the list item.
<li>Value: a string.
6. class
<li>Description: Add one or more CSS classes to the list items.
<li>Value: one or more class names separated by spaces.
7. title
<li>Description: Add a mouseover tool for list items.
<li>Value: text string.
Example:
<code class="html"><ul>
<li value="1">第一项</li>
<li type="a">第二项</li>
<li type="square" class="special">第三项</li>
</ul></code>
The above is the detailed content of Attributes of li tag in html. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn