mozilla

Revision 20543 of counter-reset

  • Revision slug: CSS/counter-reset
  • Revision title: counter-reset
  • Revision id: 20543
  • Created:
  • Creator: BijuGC
  • Is current revision? No
  • Comment /* Summary */

Revision Content

{{ CSSMozExtensionRef() }}

Summary

counter-reset is used to reset CSS Counters to a given value.

  • {{ Xref_cssinitial() }}:
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: no
  • Percentages: N/A
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}:

Syntax

counter-reset: [<identifier> <integer>?]+ | inherit | none

Values

identifier
The name of the counter to reset.
integer
The value to reset the counter to on each occurrence of the element. Defaults to 0 if not given.

You may specify as many counters to reset as you want, each separated by a space.

Related properties

Examples

h1 {
  counter-reset: chapter section 1 page;
  /* Sets the chapter and page counters to 0
     and the section counter to 1. */
}

Notes

Specifications

Browser compatibility

See also

CSS Counters, {{ Cssxref("counter-increment") }}

{{ languages( { "fr": "fr/CSS/counter-reset", "pl": "pl/CSS/counter-reset" } ) }}

Revision Source

<p> {{ CSSMozExtensionRef() }}
</p>
<h3 name="Summary"> Summary </h3>
<p><code>counter-reset</code> is used to reset <a href="en/CSS_Counters">CSS Counters</a> to a given value.
</p>
<ul><li> {{ Xref_cssinitial() }}: </li><li> Applies to: all elements
</li><li> {{ Xref_cssinherited() }}: no
</li><li> Percentages: N/A
</li><li> Media: {{ Xref_cssvisual() }}
</li><li> {{ Xref_csscomputed() }}:
</li></ul>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">counter-reset: [&lt;identifier&gt; &lt;integer&gt;?]+ | inherit | none
</pre>
<h3 name="Values"> Values </h3>
<dl><dt>identifier</dt><dd> The name of the counter to reset.
</dd><dt>integer</dt><dd> The value to reset the counter to on each occurrence of the element. Defaults to 0 if not given.
</dd></dl>
<p>You may specify as many counters to reset as you want, each separated by a space.
</p>
<h3 name="Related_properties"> Related properties </h3>
<ul><li> <a href="en/CSS/counter-increment">counter-increment</a> increases the value of specified <a href="en/CSS_Counters">CSS Counters</a> by a given amount.
</li></ul>
<h3 name="Examples"> Examples </h3>
<pre>h1 {
  counter-reset: chapter section 1 page;
  /* Sets the chapter and page counters to 0
     and the section counter to 1. */
}
</pre>
<h3 name="Notes"> Notes </h3>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS21/generate.html#propdef-counter-reset">CSS 2.1</a>
</li></ul>
<h3 name="Browser_compatibility"> Browser compatibility </h3>
<h3 name="See_also"> See also </h3>
<p><a href="en/CSS_Counters">CSS Counters</a>, {{ Cssxref("counter-increment") }}
</p>{{ languages( { "fr": "fr/CSS/counter-reset", "pl": "pl/CSS/counter-reset" } ) }}
Revert to this revision