Glubase - share your knowledge


All / Computers / Programming / CSS





  • View Command

CSS Reference

CSS counter-reset definition

Syntax

counter-reset: none | <identifier>;

Description

The counter-reset property creates or resets the specified counter. The counter is valid in the element where the counter is reset and it's descendant elements.

Values

Values Description
none Defines that no counters will be reset.
identifier Reset the counter identified by the value. For example: counter-reset:mycounter;

See Also

counter-increment

Example

[Try this example yourself]
<style type="text/css">
h1
{
    counter-reset:chapter;
}
h4:before
{
    counter-increment:chapter;
    content:"Chapter " counter(chapter) ": ";
}
</style>
<h1>Header</h1>
<h4>First Chapter</h4>
<h4>Second Chapter</h4>
<h4>Third Chapter</h4>

Output

Header

First Chapter

Second Chapter

Third Chapter

  • Comments

No comments added.