mozilla

Revision 20542 of counter-reset

  • Revision slug: CSS/counter-reset
  • Revision title: counter-reset
  • Revision id: 20542
  • Created:
  • Creator: DBaron
  • Is current revision? No
  • Comment /* See also */

Revision Content

{{template.CSSMozExtensionRef()}}

Summary

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

  • Applies to: all elements
  • Inherited: no

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, {{template.Cssxref("counter-increment")}}

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

Revision Source

<p> 
{{template.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> Applies to: all elements
</li><li> Inherited: no
</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>, {{template.Cssxref("counter-increment")}}
</p>{{ wiki.languages( { "fr": "fr/CSS/counter-reset", "pl": "pl/CSS/counter-reset" } ) }}
Revert to this revision