Web/HTML/Global attributes/part

From Get docs


The part global attribute contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element.

See our [[../../../../../../../mdn.github.io/web-components-examples/shadow-part/index|Shadow part example]] for a usage example.

Specifications

Specification Status Comment
Shadow PartsThe definition of 'part' in that specification. Working Draft

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

part

Experimental'

Chrome

Full support 73

Edge

Full support 79

Firefox Full support 72


Full support 72


No support 69 — 72

Disabled'

Disabled' From version 69 until version 72 (exclusive): this feature is behind the layout.css.shadow-parts.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

IE

No support No

Opera

Full support 60

Safari

Full support 13.1

WebView Android

Full support 73

Chrome Android

Full support 73

Firefox Android

No support No

Opera Android

?

Safari iOS

Full support 13.4

Samsung Internet Android

No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.
User must explicitly enable this feature.'
User must explicitly enable this feature.


See also

part by Mozilla Contributors is licensed under CC-BY-SA 2.5.