:heading

An experimental pseudo-class that targets any heading element (h1, h2, h3, h4, h5, or h6) automatically.

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

/* Usage Example */
:heading {
  /* Applies a consistent accent color to all headings */
  color: var(--primary-accent);
  font-family: ';Outfit', sans-serif;
}
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