Can I get the CSS counter value of the parent?

后端 未结 3 1137
一向
一向 2021-02-06 09:54

I need to implement the following list style:

01 Item 1
02 Item 2
    02a Item 2a
    02b Item 2b
03 Item 3

How can I get the counter value of the parent t

3条回答
  •  走了就别回头了
    2021-02-06 10:44

    See this: there is no way to do such things in CSS, obviously you would need to use JavaScript for it but pseudo-elements are not in the DOM afaik. As for the other answers: he wants the value of the counter that appears before the list items.

提交回复
热议问题