sibling-count() and sibling-index()Baseline · Newly available
The sibling-count() and sibling-index() CSS functions return integers that are useful to style elements based on their positions among siblings or on the number of siblings, for example as part of a calc() expression.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Aug 18, 2026.
Browser support
How to use
Every current browser supports this, but it only became Baseline on Aug 18, 2026. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: sibling-count.
Feature detection
There’s no simple runtime check for this feature; rely on the support table and test in your target browsers.
Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (2). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| <sibling-count> | 138 | 138 | 154 | 26.2 | 138 | 154 | 26.2 |
| <sibling-index> | 138 | 138 | 154 | 26.2 | 138 | 154 | 26.2 |