coderef

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

DesktopChrome
1–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Edge
12–137Not supported
138+Supportedsince Jun 26, 2025
Current: 154
Firefox
1–153Not supported
154+Supportedsince Aug 18, 2026
Current: 157
Safari
1–26.1Not supported
26.2+Supportedsince Dec 12, 2025
Current: 27
MobileChrome Android
18–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155
Firefox Android
4–153Not supported
154+Supportedsince Aug 18, 2026
Current: 157
Safari iOS
1–26.1Not supported
26.2+Supportedsince Dec 12, 2025
Current: 27

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.

Sub-features

Support for each part of the feature (2). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
<sibling-count>13813815426.213815426.2
<sibling-index>13813815426.213815426.2