:defined

Matches any element that has been officially 'defined' by the browser. This includes all standard HTML elements and any custom elements that have been registered via JavaScript.

/* Usage Example */
my-custom-element:defined {
  display: block;
  /* only shows the custom element once it's been correctly registered */
}
Widely available Since 2020 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

54+
63+
10+
79+
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