Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Ordered lists as [N.x], new code based on CSS for [x]

Discussion in 'Misc WordPress Requests' started by aclassifier, Nov 3, 2017.

  1. aclassifier

    Guest

    Ordered lists as [N.x], new code based on CSS for [x], by aclassifier

    I have had help from the mailforum css-disuss.org, but it seems dead now. And I couldn’t find another CSS forum either(?)

    I have had this ordered list for years now:

    [1] Reference 1 in here
    [2] Reference 2 in here
    [3] Reference 3 in here
    [4] Reference 4 in here

    but I now want this, where I can add ‘4’ in Text mode like “chapter:4;”

    [4.1] Reference 1 in here
    [4.2] Reference 2 in here
    [4.3] Reference 3 in here
    [4.4] Reference 4 in here

    The code that does the first (courtesy Chris Rockwell) is the below. Can anybody help me with adding a constant like ‘4’ above (at several places in the same document, like ‘3’ at another place. I’m sorry I haven’t coded CSS to any depth like that before. Here is what I have:

    ol.ol_href {
    list-style-type: none;
    counter-reset: section;
    padding-left: 0;
    }
    ol.ol_href li {
    display: table-row
    }
    ol.ol_href li:before {
    counter-increment: section;
    content: "[" counter(section) "] ";
    padding-right: 1em;
    display: table-cell;
    }

    and the usage in Text is. The ids I add by hand in Text:

    <ol class="ol_href">
    <li id="Ref_01">Reference 1 in here</li>
    <li id="Ref_02">Reference 2 in here</li>
    <li id="Ref_03">Reference 3 in here</li>
    <li id="Ref_04">Reference 4 in here</li>
    </ol>

    I would end up with something like this with the new scheme, also added by hand in Text:

    <ol class="ol_href">
    <li id="Ref_04_01">Reference 4.1 in here</li>
    <li id="Ref_04_02">Reference 4.2 in here</li>
    <li id="Ref_04_03">Reference 4.3 in here</li>
    <li id="Ref_04_04">Reference 4.4 in here</li>
    </ol>

    Ordered lists as [N.x], new code based on CSS for [x]
     
    #1

Share This Page

Web Hosting