range
Quick Summary for range (@counter-style)
When defining custom counter styles, the range descriptor lets the author specify a range of counter values over which the style is applied. If a counter value is outside the specified range, then the fallback style will be used to construct the representation of that marker.
Code Usage for range (@counter-style)
/* Keyword value */ range: auto;  /* Range values */ range: 2 5; range: infinite 10; range: 6 infinite; range: infinite infinite;  /* Multiple range values */ range: 2 5, 8 10; range: infinite 6, 10 infinite; 
More Details for range (@counter-style)

range

When defining custom counter styles, the range descriptor lets the author specify a range of counter values over which the style is applied. If a counter value is outside the specified range, then the fallback style will be used to construct the representation of that marker.

Syntax

/* Keyword value */ range: auto;  /* Range values */ range: 2 5; range: infinite 10; range: 6 infinite; range: infinite infinite;  /* Multiple range values */ range: 2 5, 8 10; range: infinite 6, 10 infinite; 

Values

auto

The range depends on the counter system:

For cyclic, numeric, and fixed systems, the range is negative infinity to positive infinity. For alphabetic and symbolic systems, the range is 1 to positive infinity. For additive systems, the range is 0 to positive infinity. For extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined style (§7 Complex Predefined Counter Styles), the range is the style's defined range. [ [ | infinite ]{2} ]#

Defines a comma-separated list of ranges. For each individual range, the first value is the lower bound and the second value is the upper bound. A range is inclusive, that means it always contains both, the lower and upper bound numbers. If infinite is used as the first value in a range, it represents negative infinity; if it is used as the second value, it represents positive infinity. The range of the counter style is the union of all the ranges defined in the list. If the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored.

Description

The value of the range descriptor can be either auto or a comma separated list of lower and upper bounds specified as integers.

If value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. For alphabetic and symbolic systems, range will be from 1 to positive infinity. For additive systems, auto will result in the range 0 to positive infinity. For extends systems, the range is whatever auto will produce for the extended system.

When range is specified as integers, the value infinite can be used to denote infinity. If infinite is specified as the first value in a range, then it is interpreted as negative infinity. If used as upper bound, it is taken as positive infinity.

Formal definition

Related at-rule@counter-style
Initial valueauto
Computed valueas specified

Formal syntax

[ [ <integer> | infinite ]{2} ]# | auto

Examples

Setting counter style over a range

<ul class="list">   <li>One</li>   <li>Two</li>   <li>Three</li>   <li>Four</li>   <li>Five</li>   <li>Six</li>   <li>Seven</li>   <li>Eight</li>   <li>Nine</li>   <li>Ten</li> </ul> 
@counter-style range-multi-example {   system: cyclic;   symbols: "\25A0" "\25A1";   range: 2 4, 7 9; }  .list {   list-style: range-multi-example; } 

The above list will display as follows:

:

Specifications

Specification
CSS Counter Styles Level 3 # counter-style-range

See also

list-style, list-style-image, list-style-position symbols(), the functional notation creating anonymous counter styles.

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown
Random CSS Property

padding-right

The padding-right CSS property sets the width of the padding area on the right of an element.
padding-right css reference