headingfunction
Limited availabilityExperimental
An experimental pseudo-class function that targets a heading of a specific level or relative level (e.g., :heading(2) for h2).
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in any major browser yet under this name.
See how modern your own CSS is.Check your CSS →
Quick example
:heading(1) {
/* Specifically targets top-level headings */
font-size: 3rem;
text-transform: uppercase;
}headingfunction browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.