::slotted

A pseudo-element used inside a Web Component (Shadow DOM) to style elements that have been 'slotted' into a <slot> tag from the light DOM.

/* Usage Example */
/* Inside the shadow DOM of a custom element */
::slotted(img) {
  /* Styles images that were passed into the component's slot */
  border-radius: 50%;
  max-width: 100px;
}
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.

50+
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