Custom ordered list format

前端 未结 3 1396
清酒与你
清酒与你 2020-12-20 19:36

I tried to use ordered list

    and each list item
  1. outputs as 1. 2. 3. ... etc, I want the output to be 1) 2) 3) ... etc, can thi
相关标签:
3条回答
  • 2020-12-20 19:54

    No, the valid options are listed >here<.

    0 讨论(0)
  • 2020-12-20 20:16

    You can, but only with the more up-to-date browsers (Chrome, Safari, Firefox and Opera will work):

    ol {
      counter-reset: listCounter;
    }
    ol li {
      counter-increment: listCounter;
    }
    ol li:before {
      content: counter(listCounter) ")";
    }
    
    0 讨论(0)
  • 2020-12-20 20:16

    You can do this with CSS counter and pseudo elements:

    ol li{
        list-style: none;
        counter-increment: myIndex;
    }
    
    ol li:before{
        content:counter(myIndex)") ";
    }
    <ol>
        <li>test</li>
        <li>test</li>
        <li>test</li>
        <li>test</li>
        <li>test</li>
    </ol>

    0 讨论(0)
提交回复
热议问题