Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 734977 of <shadow>

  • Revision slug: Web/HTML/Element/Shadow
  • Revision title: <shadow>
  • Revision id: 734977
  • Created:
  • Creator: markg
  • Is current revision? No
  • Comment fleshing out the content

Revision Content

{{ draft }}

Summary

The HTML <shadow> element is used as a shadow DOM {{glossary("insertion point")}}. You might use it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML. It is used with Web Components.

Attributes

This element includes the global attributes.

Example

text goes here

text goes here

Specifications

Specification Status Comment
{{SpecName('Shadow DOM', "#the-shadow-element", "shadow")}} {{Spec2('Shadow DOM')}}  

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 35 {{CompatGeckoDesktop("28")}} [1] {{CompatNo}} 26 {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 37 {{CompatGeckoMobile("28")}} [1] {{CompatNo}} {{CompatUnknown}} {{CompatUnknown}}

[1] If Shadow DOM is not enabled in Firefox, <shadow> elements will behave like {{domxref("HTMLUnknownElement")}}. Shadow DOM was first implemented in Firefox 33 and is behind a preference, dom.webcomponents.enabled, which is disabled by default.

See also

  • Web Components
  • {{HTMLElement("decorator")}}, {{HTMLElement("element")}}, {{HTMLElement("content")}}, {{HTMLElement("template")}}
{{HTMLRef}}

Revision Source

<p>{{ draft }}</p>

<h2 id="Summary" name="Summary">Summary</h2>

<p>The <strong><a href="/en-US/docs/Web/HTML">HTML</a>&nbsp;<code>&lt;shadow&gt;</code></strong>&nbsp;element is used as a shadow DOM {{glossary("insertion point")}}. You might use it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML. It is used with <a href="/en-US/docs/Web/Web_Components">Web Components</a>.</p>

<ul class="htmlelt">
 <li><dfn><a href="/en-US/docs/Web/HTML/Content_categories" title="HTML/Content_categories">Content categories</a></dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Transparent_content">Transparent content</a></li>
 <li><dfn>Permitted content</dfn> <a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">Flow content</a></li>
 <li><dfn>Tag omission</dfn> {{no_tag_omission}}</li>
 <li><dfn>Permitted parent elements</dfn>Any element that accepts flow content</li>
 <li><dfn>DOM interface</dfn> {{domxref("HTMLShadowElement")}}</li>
</ul>

<h2 id="Attributes" name="Attributes">Attributes</h2>

<p>This element includes the <a href="/en-US/docs/Web/HTML/Global_attributes">global attributes</a>.</p>

<h2 id="Example">Example</h2>

<p>text goes here</p>

<pre class="brush: html">
text goes here</pre>

<h2 id="Specifications">Specifications</h2>

<table class="spec-table standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Shadow DOM', "#the-shadow-element", "shadow")}}</td>
   <td>{{Spec2('Shadow DOM')}}</td>
   <td>&nbsp;</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>

<p>{{CompatibilityTable}}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>35</td>
   <td><span style="font-size: 12px; line-height: 18px;">{{CompatGeckoDesktop("28")}}</span>&nbsp;[1]</td>
   <td>{{CompatNo}}</td>
   <td>26</td>
   <td><span style="font-size: 12px; line-height: 18px;">{{CompatNo}}</span></td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>37</td>
   <td>{{CompatGeckoMobile("28")}} [1]</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] If Shadow DOM is not enabled in Firefox, <code>&lt;shadow&gt;</code> elements will behave like {{domxref("HTMLUnknownElement")}}. Shadow DOM was first implemented in Firefox 33 and is behind a preference, <code>dom.webcomponents.enabled</code>, which is disabled by default.</p>

<h2 id="See_also" name="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/Web_Components">Web Components</a></li>
 <li>{{HTMLElement("decorator")}}, {{HTMLElement("element")}}, {{HTMLElement("content")}}, {{HTMLElement("template")}}</li>
</ul>

<div>{{HTMLRef}}</div>
Revert to this revision