The counter-reset property in CSS is used to create or reset the CSS counter for elements. This property works together with counter-increment property and the content property.
counter-reset = none|name number|initial|inherit;
- none: It is the default value. This value does not reset the counter.
- name number: The value to reset the counter on each occurrence of the element. The default value is 0 if not specified.
- initial: It sets the counter-reset property to its default value.
- inherit: The element inherits the property from its parent element.
Example 1: This example use counter-reset property to create section.
Example 2: This example use counter-reset property to create section and subsection.
Supported Browsers: The browser supported by counter-reset property are listed below:
- Google Chrome 4.0
- Internet Explorer 8.0
- Firefox 2.0
- Safari 3.1
- Opera 9.6
- HTML | DOM Style counterReset Property
- CSS | transition-property Property
- How to override the CSS properties of a class using another CSS class ?
- Difference between bootstrap.css and bootstrap-theme.css
- CSS | table-layout Property
- CSS | text-align Property
- CSS | border-top-width Property
- CSS | isolation Property
- CSS | border-inline-start-style Property
- CSS | column-rule-width Property
- CSS | word-spacing Property
- CSS | animation-delay Property
- CSS | margin-top Property
- CSS | border radius property
- CSS | grid Property
- CSS | font-size-adjust Property
- CSS | visibility Property
- CSS | Display property
- CSS | grid-template-columns Property
- CSS | height Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.