Style an Ordered List like “1.1, 1.2” instead of “1, 2”

后端 未结 2 1343
伪装坚强ぢ
伪装坚强ぢ 2020-12-21 14:26

NOTE:

Due to some of the answers/comments left below (with which I agree), I feel this question is too vague, and does not explain sufficiently my problem. I was t

2条回答
  •  悲哀的现实
    2020-12-21 14:44

    Took a while to figure this one out!

    here is my fiddle

     h2.title {
       font-size: 20px;
       font-weight: 800;
       margin-left: -20px;
       padding: 12px;
       counter-increment: ordem;
     }
     li.heading {
       font-size: 16px;
       font-weight: bold;
       padding: 12px;
       list-style-type: none;
     }
     .bullet {
       counter-reset: bullet;
       padding-left: 12px;
     }
     .bullet li {
       list-style-type: none;
     }
     .bullet li:before {
       counter-increment: bullet;
       content: counter(ordem)"." counter(bullet)" ";
     }
     ol.none {
       list-style: none!important
     }
     li.s2sub::before {
       counter-increment: none!important;
       content: none!important;
     }
     li.s2sub {
       list-style: upper-alpha;
     }
     li.s3sub::before {
       counter-increment: none!important;
       content: none!important;
     }
     li.s3sub {
       list-style-type: circle;
     }
     li.roman::before {
       counter-increment: none!important;
       content: none!important;
     }
     li.roman {
       list-style: lower-roman inside;
     }
    
      

      Section 1

    1. Heading 1
      1. text 1 one
      2. text 1 two
      3. text 1 three
      4. text 1 four
    2. Heading 2
      1. Item 1
      2. Item 2
      3. Item 3

      Section 2

      1. First item
        1. First subitem
        2. Second subitem
      2. Second Item
      3. Third Item

      Section 3

      1. First item
        1. First subitem
        2. Second subitem
      2. Second item
      3. Third item

提交回复
热议问题