Course Content
About Lesson

Attributes for Lists

In HTML, you can use various attributes to customize the appearance and behavior of lists. Here are some commonly used attributes for lists along with their syntax:


Specifies the type of marker to use in an ordered list. The values can be “1” (default, numbers), “A” (uppercase letters), “a” (lowercase letters), “I” (uppercase Roman numerals), or “i” (lowercase Roman numerals).

<ol type="A">
 <li>Item 1</li>
 <li>Item 2</li>
</ol>

Specifies the starting value of the first list item in an ordered list.

<ol start="10">
 <li>Item 10</li>
 <li>Item 11</li>
</ol>

Specifies the value of an individual list item in an ordered list. This attribute can be used to override the default numbering.

<ol>
 <li value="100">Item 100</li>
 <li>Item 101</li>
</ol>

Indicates that the list should render with reduced spacing between list items. This attribute is deprecated in HTML5 and is not recommended for use.

<ul compact>
 <li>Item 1</li>
 <li>Item 2</li>
</ul>

Specifies the type of bullet or marker to use in an unordered list. The values can be “disc” (default filled circle), “circle” (hollow circle), or “square” (filled square).

<ul type="circle"> <!--circle, disk, square-->
 <li>Item 1</li>
 <li>Item 2</li>
</ul>

Please note that the ‘type‘ attribute for unordered lists (<ul>) is not supported in HTML5, and it’s recommended to use CSS for styling list markers instead. Also, the compact attribute for lists is deprecated and should not be used in modern HTML documents. It’s better to use CSS for controlling the spacing and appearance of lists.