Numbering ordered lists: Difference between revisions

(Created page with "To number nested ordered lists , you can add the following CSS to the page ''MediaWiki:Common.css''.<syntaxhighlight lang="text"> .mw-content-ltr ol, .ve-ce-branchNode ol{ co...")
Tag: 2017 source edit
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
To number nested ordered lists , you can add the following CSS to the page ''MediaWiki:Common.css''.<syntaxhighlight lang="text">


.mw-content-ltr ol, .ve-ce-branchNode ol{ counter-reset: item; margin-left:1.5em }
To create numbering as 1., 1.1, 1.1.1 and so on, use the following style:<syntaxhighlight lang="text">
.mw-content-ltr li { display: block }
/*Numbered and unordered lists*/
.mw-content-ltr li:before, .ve-ce-branchNode li:before { content: counters(item, ".") "."; counter-increment: item; margin-right:0.5em  }
#mw-content-text ol ::marker {
.ve-ce-branchNode li p { display: inline}
    content: counters(list-item,'.')". ";
</syntaxhighlight>
}
#mw-content-text ol li::before {
    content:"\00a0\00a0"
}
#mw-content-text ol {
    margin-left:1.4em;
}
#mw-content-text ol ol {
    margin-left:2.6em;
}
/*Number footnotes separately */
#mw-content-text  .references ::marker {
    content: " ";
}
#mw-content-text  ol.references {
    counter-reset:ref; list-style-type:none;
}
#mw-content-text  ol.references li:before{
    counter-increment:ref;
    content:counter(ref) ". ";
    float: left;
    margin-right: 1em;
}
#mw-content-text ol > li li {
    margin-left:-0.3em;
}
</syntaxhighlight>Output:


Output:
# Step 1
 
## Substep 1
# Schritt 1
## Substep 2
## Unterschritt 1
### Subsubstep 1
## Unterschritt 2
# Step 2
### Unterschritt Level 2


[[Category:Customization]]
[[Category:Customization]]
[[en:{{FULLPAGENAME}}]]
[[en:{{FULLPAGENAME}}]]
[[de:Aufzählungslisten_nummerieren]]
[[de:Aufzählungslisten_nummerieren]]

Latest revision as of 16:52, 12 June 2023

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

/*Numbered and unordered lists*/
#mw-content-text ol ::marker {
    content: counters(list-item,'.')". ";
}
#mw-content-text ol li::before {  
    content:"\00a0\00a0"
}
#mw-content-text ol {
    margin-left:1.4em;
}
#mw-content-text ol ol {
    margin-left:2.6em;
}
/*Number footnotes separately */
#mw-content-text  .references ::marker {
    content: " ";	
}
#mw-content-text  ol.references {
    counter-reset:ref; list-style-type:none;
}
#mw-content-text  ol.references li:before{
    counter-increment:ref;
    content:counter(ref) ". ";
    float: left;
    margin-right: 1em;
	}
#mw-content-text  ol > li li {
    margin-left:-0.3em;
}

Output:

  1. Step 1
    1. Substep 1
    2. Substep 2
      1. Subsubstep 1
  2. Step 2



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

Discussions