Im not sure what its called but is it possible to achieve the format of:
1.
1.1
1.2
1.2.1
1.2.2
1.3
I think thats all, thanks!
Using counter-increment instead of start If you start a list, then stop to interject some other content, then begin the list again, you could use <ol start="..."> to continue numbering where you left off.
The start attribute specifies the start value of the first list item in an ordered list. This value is always an integer, even when the numbering type is letters or romans. E.g., to start counting list items from the letter "c" or the roman number "iii", use start="3".
Items will be numbered from high to low. start HTML5. This integer attribute specifies the start value for numbering the individual list items. This value is always represented as an Arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or Roman numerals.
The <ol> HTML element represents an ordered list of items — typically rendered as a numbered list. Flow content, and if the <ol> element's children include at least one <li> element, palpable content .
For example, to start numbering elements from the letter "d" or the Roman numeral "iv," use start="4". The specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element.
The <li> tag is used to define each list item. Tip: Use CSS to style lists. Tip: For unordered list, use the <ul> tag. Specifies that the list order should be reversed (9,8,7...) The <ol> tag also supports the Global Attributes in HTML. The <ol> tag also supports the Event Attributes in HTML.
Several options, in fact, varying in robustness and support:
Or you can turn to CSS counters. This is probably the best option, if you don't need to support legacy versions of IE, where it is supported since version 8.
Counters are "self-nesting", in the sense that resetting a counter in a descendant element or pseudo-element automatically creates a new instance of the counter. This is important for situations like lists in HTML, where elements can be nested inside themselves to arbitrary depth. It would be impossible to define uniquely named counters for each level.
Example(s):
Thus, the following suffices to number nested list items. The result is very similar to that of setting 'display:list-item' and 'list-style: inside' on the LI element:
OL { counter-reset: item } OL>LI { display: block } OL>LI:before { content: counters(item, ".") ". "; counter-increment: item }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With