What is the use of the counter-reset attribute in css
This article is about the usefulness of the counter-reset attribute in css. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Used to define and initialize one or more css counters. Sets the name and initial value of the counter.
2. The initial value of the counter is not the first number when the counter is displayed. If you want the counter to be displayed from 1, you need to set the initial value in coutter-reset to 0.
Grammar
Counter-reset: [?] + | none | inherit
Example
SomeSelector {counter-reset:counterA;/* counter counterA initial, initial value is 0 seconds / counter-reset:counterA 6 counterB * initial counter counterA, initial value is 6 seconds / counter-reset:counterA 4 counterB; / * counter counterA initial value is 4, counter counterB initial value is 0 seconds / counter-reset:counterA 4 counterB 2 / * initial counter counterA, initial value 4, initial counter counterB, initial value 2 seconds /} Thank you for reading! This is the end of this article on "what is the use of counter-reset attributes in css?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!