This is to create a multi-level list of the sort more often seen in print media - such as an outline or a set of instructions.
To create a multilevel list in HTML, nest each list level into a parent list item. Style the levels with css (ideally with classes) to create a custom style list.
The css list item <li> property sets the position for the list item.
The css list-style-type property sets the marker (bullet) style for the list-item.
This list changes the style by declaring the list-style-type for the list level in the html.
<ol style="list-style-type: lower-alpha;">
By changing the default styling, any style of list can be created to match a standard set of list levels.
Common CSS list-style-type values
The bullets may vary by browser.
The common appearance is:
Note that a negative margin has been used to reduce the indent of the lower level lists.
This uses a set of custom properties to select the css list styles:
- {
- --ur: upper-roman;
- --lr: lower-roman;
- etc.
- --ds: disc;
- --ci: circle;
- etc.
- }
Then build the list by declaring the variable that corrisponds to the style to be set for that level.
To change the list style, change the custom property (between the parentheses).
-
.l1 {
list-style-type: var(--ur);
}
-
.l1 {
list-style-type: var(--lr);
}
This html can be used for a template.