Common List Attributes in HTML

The <ol> element can take a number of attributes to influence numbering or lettering of the list items. The most commonly used attributes are the start attribute, which specifies the start value for numbering or lettering items, and the type attribute, which specifies the kind of marker to use for numbering or lettering, which must be 1, a, A, i, or I. Figure 4.3 shows both attributes in use, and Figure 4.4 depicts the result. Note that the type attribute should be used only where the type of marker plays an important role, such as in legal documents, where items are referred to from elsewhere in a document by their number or letter; otherwise, the CSS list-style-type property, which is used to specify list-item markers, should be used, since specifying list-item markers is considered styling in Web design. List-item markers for the <ul> element can also be changed using this property. For example, it can be used to specify custom bullets points made from images. The property is discussed more fully in Chapter 17.

Source: Sklar David (2016), HTML: A Gentle Introduction to the Web’s Most Popular Language, O’Reilly Media; 1st edition.

Leave a Reply

Your email address will not be published. Required fields are marked *