Need a bulleted list and want to control what the bullet looks like or a numbered list that shows roman numerals rather than plain numeric ones? Control it all through CSS.
There are three different types of lists: Unordered lists which typically display some type of bullet, Ordered lists which follow an alpha or numeric sequence, and Definition lists that consist of a term and its definition.
Unordered lists begin with opening <ul> tag with the individual list items <li> .... </li> contained within and ends with the closing </ul> tag. An example of the coding for an unordered list looks like this:
The unordered list properties allow you to control the appearance of your lists by choosing a "marker" (such as a disc, circle, or square) or by setting a small image. You can also then determine where the marker is placed.
There are three properties used to control the appearance of an unordered list:
It is important to note that both unordered and ordered lists use the same <li> tag within it. When you define a style for lists, you must define the both the type of list as well as the list item. If you don't, then all list items would look the same whether they are in an ordered or unordered list.
List-style-image: The list-style-image property lets you use a small graphic image in place of a bullet in a list. A typical rule would look like this:
Because list items can have up to three levels of bullets, you can define a different bullet for each level. For second and third level bullets, your style coding would look similar to this:
List-style-type: The list-style-type property controls the type of bullet used for list items. The possible values are disk, circle, square, and none. You can also define a different type of bullet for all three levels as follows:
List-style-position: The list-style-position property controls the alignment of text with respect to the list item bullet. The two possible values are inside or outside. Inside aligns subsequent lines of text with the bullet. An outside value causes subsequent lines of wrapped text to line up with the first letter in the first line of text.
If you have ever had to do an outline for a school paper, you are already familiar with ordered lists. These follow a numerical and/or alphabetical sequence such as decimal (1, 2, 3 ), lower roman (i, ii, iii), upper roman (I, II, III), and upper alpha (A, B, C).
Ordered lists also use the list-style-type:
As with unordered lists, ordered lists can also be defined for up to three levels:
A definition list consists of three HTML parts: the definition list container <dl>, the definition term <dt>, and the definition description <dd>. All three parts can be styled, but only the definition description <dd> can contain block level items like paragraph <p> tags.
If you are unfamiliar with definition lists, consider the advantages of styling your FAQ page. Typically you have a question (the definition term) followed by an answer (the definition description). The following is an example:
If you are curious about the possibilities of Definition Lists, I recommend you visit the sites below (will open in a new window).
https://www.maxdesign.com.au/presentation/definition/
https://www.cssplay.co.uk/menus/