• Multi-level numbered lists without trailing dot on sub-levels?

    From Stan Brown@21:1/5 to Robert Prins on Sat Jan 16 10:52:04 2021
    On Sat, 16 Jan 2021 20:34:09 +0000, Robert Prins wrote:

    ol.ml li:before {
    counter-increment:list;
    content: counters(list, ".") ". ";
    }

    By using the above, I can create lists with
    1.
    1.1.
    1.2.
    etc numbering, which is what I (almost) need. However, is there a
    way of removing the final '.' on the *lower* levels, so that the
    above would come out as
    1.
    1.1
    1.2
    which is waht I really "need"?

    The selector to access a lower-level list is ol.ml ol.ml li { ... }.

    This specifies <ol class="ml>, within it another <ol class="ml">, and
    within that an <li>.

    Think of the space between tags and classes as meaning "containing".
    Since it is more specfic, it will override any conflicting properties
    in your "om.ml li:before" selector.

    --
    Stan Brown, Tehachapi, California, USA
    https://BrownMath.com/
    https://OakRoadSystems.com/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Prins@21:1/5 to All on Sat Jan 16 20:34:09 2021
    ol.ml {
    list-style-type:none;
    counter-reset:list;
    }
    ol.ml li:before {
    counter-increment:list;
    content: counters(list, ".") ". ";
    }

    By using the above, I can create lists with

    1.
    1.1.
    1.2.
    1.2.1.
    2.
    2.1.
    2.1.1.
    2.1.2.

    etc numbering, which is what I (almost) need. However, is there a way of removing the final '.' on the *lower* levels, so that the above would come out as

    1.
    1.1
    1.2
    1.2.1
    2.
    2.1
    2.1.1
    2.1.2

    which is waht I really "need"?

    Thanks,

    Robert
    --
    Robert AH Prins
    robert(a)prino(d)org
    The hitchhiking grandfather - https://prino.neocities.org/indez.html
    Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)