Numbering ordered lists: Difference between revisions

No edit summary
No edit summary
Line 14: Line 14:
### Sub-substep 1
### Sub-substep 1


Alternatively, to create numbering as 1., 1.1, 1.1.1 and so on use the following style:<syntaxhighlight lang="text">
article ol {
counter-reset:section; list-style-type:none;
}
article ol li {
list-style-type:none;
}
article ol li ol {
counter-reset:subsection;
}
article ol li ol li ol{
counter-reset:subsubsection;
}
article ol li:before{
    counter-increment:section;
    content:counter(section) ". ";/*content:"Section " counter(section) ". ";*/
    float: left;
    margin-right: 0.4em;
}
article ol li ol li:before {
    counter-increment:subsection;
    content:counter(section) "." counter(subsection) " ";
}
article ol li ol li ol li:before {
    counter-increment:subsubsection;
    content:counter(section) "." counter(subsection) "." counter(subsubsection) "" ;
}
</syntaxhighlight>
[[Category:Customization]]
[[Category:Customization]]
[[en:{{FULLPAGENAME}}]]
[[en:{{FULLPAGENAME}}]]
[[de:Aufzählungslisten_nummerieren]]
[[de:Aufzählungslisten_nummerieren]]

Revision as of 09:37, 30 September 2022

To number nested ordered lists , you can add the following CSS to the page MediaWiki:Common.css.

/*Numbering nested ordered lists */
.mw-content-ltr ol, .ve-ce-branchNode ol{ counter-reset: item; margin-left:1.5em }
.mw-content-ltr ol li { display: block }
.mw-content-ltr ol li:before, .ve-ce-branchNode ol li:before { content: counters(item, ".") "."; counter-increment: item; margin-right:0.5em  }
.ve-ce-branchNode ol li p { display: inline}

Output:

  1. Step 1
    1. Substep 1
    2. Substep 2
      1. Sub-substep 1


Alternatively, to create numbering as 1., 1.1, 1.1.1 and so on use the following style:

article ol { 
	counter-reset:section; list-style-type:none; 
	}
article ol li { 
	list-style-type:none; 
	}
article ol li ol { 
	counter-reset:subsection; 
	}
article ol li ol li ol{ 
	counter-reset:subsubsection; 
	}	
article ol li:before{
    counter-increment:section;
    content:counter(section) ". ";/*content:"Section " counter(section) ". ";*/
    float: left;
    margin-right: 0.4em;
	}
article ol li ol li:before {
    counter-increment:subsection;
    content:counter(section) "." counter(subsection) " ";
	}
article ol li ol li ol li:before {
    counter-increment:subsubsection;
    content:counter(section) "." counter(subsection) "." counter(subsubsection) "" ;
	}



To submit feedback about this documentation, visit our community forum.