Numbering ordered lists: Difference between revisions

No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:


To create numbering as 1., 1.1, 1.1.1 and so on, use the following style:<syntaxhighlight lang="text">
To create numbering as 1., 1.1, 1.1.1 and so on, use the following style:<syntaxhighlight lang="text">
article ol {
/*Numbered and unordered lists*/
counter-reset:section;
#mw-content-text ol ::marker {
list-style-type:none;
     content: counters(list-item,'.')". ";
     display: table;
}
    margin-left:1.4em!important;
#mw-content-text ol li::before {
}
     content:"\00a0\00a0"
article ol > li {
}
list-style-type:none;
#mw-content-text ol {
    display: table-row;
     margin-left:1.4em;
}
}
article ol > li ol {
#mw-content-text ol ol {
counter-reset:subsection;
     margin-left:2.6em;
}
}
article ol li ol > li ol{
/*Number footnotes separately */
counter-reset:subsubsection;
#mw-content-text  .references ::marker {
}
     content: " ";
article ol > li:before{
}
    counter-increment:section;
#mw-content-text  ol.references {
     content:counter(section) ". ";
    counter-reset:ref; list-style-type:none;
    display: table-cell;
}
    text-align: right;
#mw-content-text  ol.references li:before{
     padding-right: 0.5em;
}
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) "" ;
}
article li  {
    line-height:1.4em
    }
article li p {
    line-height:1.8em;margin-top:0; margin-bottom:0
    }
/*Count footnotes separately*/
article ol.references {  
counter-reset:ref; list-style-type:none;  
}
article ol.references li:before{
     counter-increment:ref;
     counter-increment:ref;
     content:counter(ref) ". ";
     content:counter(ref) ". ";
     float: left;
     float: left;
     margin-right: 0.4em;
     margin-right: 1em;
}
}
#mw-content-text  ol > li li {
    margin-left:-0.3em;
}
</syntaxhighlight>Output:
</syntaxhighlight>Output:



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