4.1 List Attributes

There are some useful attributes for use with HTML lists that help us control certain display factors:

AttributePurpose
startDefines the starting number for a list
typeDefines the type of bullet or numbering used for lists - see next table below
value Defines the starting number for a list item

Starting with the type attribute, the values vary and depend upon whether an unordered list or ordered list is being used:

List TypeValues for TypeFormatExample
ULdiscA solid donut
circleAn unfilled circle
squareA solid square
OL1Numbers1, 2 , 3
aLowercase Lettersa, b, c
AUppercase LettersA, B, C
iLowercase Roman Numeralsi, ii, iii
IUppercase Roman NumeralI,II,III

By default most browsers set the bullet points of unordered lists to disc and ordered lists to numbers starting at 1 unless specified otherwise. These can be overwritten using the values above. Note that the start and value attributes always use numbers but can be used with any of the type attribute values. For example, if type is set to letters and start is set to 5, the letters will begin at E. Here is an example using some of the above:

<ol type="i" start="5">
 <li>A list item;</li>
 <li>Another list item.</li>
 <li value="10">Yet another list item.</li>
</ol>

This would look like this in a browser:

  1. A list item;
  2. Another list item;
  3. Yet another list item;

Unfortunately all these attributes and their corresponding values are now deprecated and are better handled using CSS. This will be covered in the CSS Tutorial later.