headingfunction

An experimental pseudo-class function that targets a heading of a specific level or relative level (e.g., :heading(2) for h2).

This is an experimental technology. The syntax and behavior are still subject to change.

/* Usage Example */
:heading(1) {
  /* Specifically targets top-level headings */
  font-size: 3rem;
  text-transform: uppercase;
}
Limited availability Since 2020 Unknown global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

preview+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC