aboutsummaryrefslogtreecommitdiff
path: root/files/ca/web/html/element/content/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ca/web/html/element/content/index.html')
-rw-r--r--files/ca/web/html/element/content/index.html168
1 files changed, 168 insertions, 0 deletions
diff --git a/files/ca/web/html/element/content/index.html b/files/ca/web/html/element/content/index.html
new file mode 100644
index 0000000000..7fc9c0c35b
--- /dev/null
+++ b/files/ca/web/html/element/content/index.html
@@ -0,0 +1,168 @@
+---
+title: <content>
+slug: Web/HTML/Element/content
+tags:
+ - Deprecated
+ - Element
+ - HTML
+ - NeedsContent
+ - Reference
+ - Web
+ - Web Components
+translation_of: Web/HTML/Element/content
+---
+<p>{{Deprecated_header}}</p>
+
+<p>L'element <strong><a href="/en-US/docs/Web/HTML">HTML</a> <code>&lt;content&gt;</code></strong> s'utilitza a l'interior de <a href="/en-US/docs/Web/Web_Components/Shadow_DOM">Shadow DOM</a> como un {{glossary("insertion point")}}. No està destinat a ser utilitzat en HTML ordinari. S'utilitza amb components <a href="/en-US/docs/Web/Web_Components">Web Components</a>. Ara s'ha reemplaçat per l'element <strong>&lt;slot&gt;</strong>.</p>
+
+<div class="note">
+<p><strong>Nota: </strong><span id="result_box" lang="ca"><span>Encara</span> <span>present</span> <span>en primer</span> <span>esborrany de les</span> <span>especificacions</span> <span>i</span> <span>posat en</span> <span>pràctica</span> <span>en diversos</span> <span>navegadors,</span> <span>aquest</span> <span>element</span> <span>s'ha</span> <span>eliminat en</span> <span>les</span> <span>versions</span> <span>posteriors</span> <span>de l'especificació.</span></span></p>
+</div>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/en-US/docs/Web/HTML/Content_categories" title="HTML/Content_categories">Categories de contingut</a></th>
+ <td><a href="/en-US/docs/Web/HTML/Content_categories#Transparent_content_model" title="HTML/Content_categories#Transparent_content_model">Contingut transparent</a>.</td>
+ </tr>
+ <tr>
+ <th scope="row">Contingut permès</th>
+ <td><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">c</a><a href="/en-US/docs/Web/HTML/Content_categories#Flow_content">ontingut dinàmic</a>.</td>
+ </tr>
+ <tr>
+ <th scope="row">Omissió de l'etiqueta</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Elements pares permesos</th>
+ <td><span class="short_text" id="result_box" lang="ca"><span>Qualsevol</span> <span>element</span> <span>que accepti</span> <span>contingut</span> <span>dinàmic</span></span> .</td>
+ </tr>
+ <tr>
+ <th scope="row">Interfície DOM</th>
+ <td>{{domxref("HTMLContentElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Attributes" name="Attributes">Atributs</h2>
+
+<p>Aquest element inclou els <a href="/en-US/docs/Web/HTML/Global_attributes">atributs globals</a>.</p>
+
+<dl>
+ <dt>select</dt>
+ <dd><span id="result_box" lang="ca"><span>Una</span> <span>llista</span> <span>separada per</span> <span>comes dels</span> <span>selectors.</span> <span>Aquests</span> <span>tenen</span> <span>la mateixa</span> <span>sintaxi</span> <span>que els</span> <span>selectors</span> <span>CSS.</span> <span>Seleccionen</span> <span>el contingut per</span> <span>inserir en</span> <span>lloc de l'element</span></span> <code>&lt;content&gt;</code>.</dd>
+</dl>
+
+<h2 id="Exemple">Exemple</h2>
+
+<p><span id="result_box" lang="ca"><span>Aquí és un</span> <span>simple exemple</span> <span>d'ús</span> <span>de l'element</span></span> <code>&lt;content&gt;</code> <span id="result_box" lang="ca"><span>És un arxiu</span> <span>HTML</span> <span>amb tot el necessari</span><span>.</span></span></p>
+
+<div class="note">
+<p><strong>Nota:</strong> Perquè aquest codi funcioni, i es visualitzi en el navegador, ha de ser compatible amb els components web. Veure <a href="/en-US/docs/Web/Web_Components#Enabling_Web_Components_in_Firefox">Habilitació de Components Web en Firefox</a>.</p>
+</div>
+
+<pre class="brush: html">&lt;html&gt;
+ &lt;head&gt;&lt;/head&gt;
+ &lt;body&gt;
+  &lt;!-- The original content accessed by &lt;content&gt; --&gt;
+  &lt;div&gt;
+    &lt;h4&gt;My Content Heading&lt;/h4&gt;
+    &lt;p&gt;My content text&lt;/p&gt;
+  &lt;/div&gt;
+
+  &lt;script&gt;
+  // Get the &lt;div&gt; above.
+  var myContent = document.querySelector('div');
+  // Create a shadow DOM on the &lt;div&gt;
+  var shadowroot = myContent.createShadowRoot();
+  // Insert into the shadow DOM a new heading and
+  // part of the original content: the &lt;p&gt; tag.
+  shadowroot.innerHTML =
+  '&lt;h2&gt;Inserted Heading&lt;/h2&gt; &lt;content select="p"&gt;&lt;/content&gt;';
+  &lt;/script&gt;
+
+ &lt;/body&gt;
+&lt;/html&gt;
+</pre>
+
+<p>Si es pot veure en un navegador web, ha de ser similar al següent.</p>
+
+<p><img alt="content example" src="https://mdn.mozillademos.org/files/10077/content-example.png" style="height: 383px; width: 716px;"></p>
+
+<h2 id="Especificacions">Especificacions</h2>
+
+<table class="spec-table standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Especificació</th>
+ <th scope="col">Estat</th>
+ <th scope="col">Comentari</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Shadow DOM', "#the-content-element", "content")}}</td>
+ <td>{{Spec2('Shadow DOM')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">Navegadors compatibles</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Característica</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>35</td>
+ <td><span style="font-size: 12px; line-height: 18px;">{{CompatGeckoDesktop("28")}}</span> [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>Característica</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Suport bàsic</td>
+ <td>37</td>
+ <td>{{CompatGeckoMobile("28")}} [1]</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<p>[1] Si Shadow DOM no està activat en Firefox, els elements <code>&lt;content&gt;</code> es comportaran com {{domxref("HTMLUnknownElement")}}. Shadow DOM es va implementar per primera vegada a Firefox 33 i està darrere d'una preferència, <code>dom.webcomponents.enabled</code>, que està desactivada per defecte.</p>
+
+<h2 id="See_also" name="See_also">Veure</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/Web_Components">Web Components</a></li>
+ <li>{{HTMLElement("shadow")}}, {{HTMLElement("template")}}, {{HTMLElement("element")}}</li>
+</ul>
+
+<div>{{HTMLRef}}</div>