Numbering ordered lists: Difference between revisions

No edit summary
No edit summary
Tag: 2017 source edit
Line 1: Line 1:
To number bullets in the page text consecutively, you can add the following CSS to the page ''MediaWiki:Common.css''. Please note that this custom styling  may not work if it is incompatible with CSS declarations from other stylesheets in the wiki.
{{Textbox|boxtype=important|header=Wichtig!|text=This styling does NOT apply in the PDF export.|icon=yes}}


To create numbering as 1., 1.1, 1.1.1 and so on, use the following style:<syntaxhighlight lang="text">
<syntaxhighlight lang="css">
/*Numbered and unordered lists*/
/* Styles for formatting sub-ordered-list-items with 1.1., 1.1.1., etc.)*/
#mw-content-text ol ::marker {
    content: counters(list-item,'.')". ";
/* First, set all numbered lists to use coSub-reset */
#mw-content-text ol, ol.ve-ce-branchNode {
      coSub-reset: item;
      margin: 0.3em 0 0 2.2em;
}
}
#mw-content-text ol li::before {
 
    content:"\00a0\00a0"
/* Display all list items in a numbered list in block display */
#mw-content-text ol>li, ol.ve-ce-branchNode>li {
      display: block;
}
}
#mw-content-text ol {
ol.ve-ce-branchNode>li > p {display:inline}
    margin-left:1.4em;
 
/* Use a coSub that checks the number of items and adds a "." between them and ends with ". " */
#mw-content-text ol>li:before, ol.ve-ce-branchNode>li:before {  
      content: coSubs(item, ".") ". ";
      coSub-increment: item;
}
}
#mw-content-text ol ol {
</syntaxhighlight>Ausgabe:
    margin-left:2.6em;
 
}
# Step 1
/*Number footnotes separately */
## Substep 1
#mw-content-text  .references ::marker {
## Substep 2
    content: " ";
### SubSubstep 1
}
### SubSubstep 2
#mw-content-text  ol.references {
### SubSubstep 3
    counter-reset:ref; list-style-type:none;
# Step 2
}
# Step 2
#mw-content-text  ol.references li:before{
# Step 2
    counter-increment:ref;
Aufzählungslisten, die nicht nummeriert sind, sind nicht von der CSS-Anweisung betroffen:
    content:counter(ref) ". ";
 
    float: left;
* List item
    margin-right: 1em;
** List item level 2
}
*** List item level 3
#mw-content-text  ol > li li {
 
    margin-left:-0.3em;
 
}
</syntaxhighlight>Output:


# Step 1
# Step 1
## Substep 1
## Substep 1
## Substep 2
## Substep 2
### Subsubstep 1
### SubSubstep 1
### SubSubstep 2
### SubSubstep 3
# Step 2
# Step 2
# Step 2
# Step 2


[[Category:Customization]]
 
[[en:{{FULLPAGENAME}}]]
[[Kategorie:Anpassung]]
[[de:Aufzählungslisten_nummerieren]]
[[de:{{FULLPAGENAME}}]]
[[en:Numbering ordered lists]]

Revision as of 13:02, 17 July 2024

To number bullets in the page text consecutively, you can add the following CSS to the page MediaWiki:Common.css. Please note that this custom styling may not work if it is incompatible with CSS declarations from other stylesheets in the wiki.

Wichtig!This styling does NOT apply in the PDF export.


/* Styles for formatting sub-ordered-list-items with 1.1., 1.1.1., etc.)*/
	
/* First, set all numbered lists to use coSub-reset */
#mw-content-text ol, ol.ve-ce-branchNode {
      coSub-reset: item;
       margin: 0.3em 0 0 2.2em;
}

/* Display all list items in a numbered list in block display */
#mw-content-text ol>li, ol.ve-ce-branchNode>li {
      display: block;
}
ol.ve-ce-branchNode>li > p {display:inline}

/* Use a coSub that checks the number of items and adds a "." between them and ends with ". " */
#mw-content-text ol>li:before, ol.ve-ce-branchNode>li:before { 
      content: coSubs(item, ".") ". "; 
      coSub-increment: item;
}

Ausgabe:

  1. Step 1
    1. Substep 1
    2. Substep 2
      1. SubSubstep 1
      2. SubSubstep 2
      3. SubSubstep 3
  2. Step 2
  3. Step 2
  4. Step 2

Aufzählungslisten, die nicht nummeriert sind, sind nicht von der CSS-Anweisung betroffen:

  • List item
    • List item level 2
      • List item level 3


  1. Step 1
    1. Substep 1
    2. Substep 2
      1. SubSubstep 1
      2. SubSubstep 2
      3. SubSubstep 3
  2. Step 2
  3. Step 2
  4. Step 2


Kategorie:Anpassung



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