From a55b575e8089ee6cab7c5c262a7e6db55d0e34d6 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:46:50 +0100 Subject: unslug es: move --- files/es/web/html/element/slot/index.html | 126 ++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 files/es/web/html/element/slot/index.html (limited to 'files/es/web/html/element/slot/index.html') diff --git a/files/es/web/html/element/slot/index.html b/files/es/web/html/element/slot/index.html new file mode 100644 index 0000000000..b7a7407d83 --- /dev/null +++ b/files/es/web/html/element/slot/index.html @@ -0,0 +1,126 @@ +--- +title: +slug: Web/HTML/Elemento/slot +tags: + - Componentes Web + - Componentes Web HTML + - Elemento + - HTML + - Referencia + - slot + - sombra dom +translation_of: Web/HTML/Element/slot +--- +

{{HTMLRef}}

+ +

El elemento HTML <slot> —parte de la suite tecnologica Web Components — es un placeholder en un componente que tu puedes llenar con tu propio marcado, que te permite crear árboles DOM por separado y presentarlos juntos.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Categorias de contenidoContenido de flujo, contenido de fraseo
Contenido permitidoTransparente
Eventos{{event("slotchange")}}
Omisión de etiqueta{{no_tag_omission}}
Parentes permitidosCualquier elemento que acepte contenido de fraseo
Rol ARIA implícitoNo corresponding role
Roles ARIA PermitidosNo se permite role
Interfaz DOM{{domxref("HTMLSlotElement")}}
+ +

Atributos

+ +

Este elemento incluye los atributos globales.

+ +
+
   {{htmlattrdef("name")}}
+
El nombre del slot.
+
Un slot nombrado es un elemento <slot>  con el atributo  name.
+
+ +

Ejemplos

+ +
<template id="element-details-template">
+  <style>
+    details {font-family: "Open Sans Light",Helvetica,Arial}
+    .name {font-weight: bold; color: #217ac0; font-size: 120%}
+    h4 { margin: 10px 0 -8px 0; }
+    h4 span { background: #217ac0; padding: 2px 6px 2px 6px }
+    h4 span { border: 1px solid #cee9f9; border-radius: 4px }
+    h4 span { color: white }
+    .attributes { margin-left: 22px; font-size: 90% }
+    .attributes p { margin-left: 16px; font-style: italic }
+  </style>
+  <details>
+    <summary>
+      <span>
+        <code class="name">&lt;<slot name="element-name">NEED NAME</slot>&gt;</code>
+        <i class="desc"><slot name="description">NEED DESCRIPTION</slot></i>
+      </span>
+    </summary>
+    <div class="attributes">
+      <h4><span>Attributes</span></h4>
+      <slot name="attributes"><p>None</p></slot>
+    </div>
+  </details>
+  <hr>
+</template>
+ +
+

Nota: Puedes ver este ejemplo en accion en  element-details (velo running live). Además, puedes encontrar una explicación en Using templates and slots.

+
+ + + +

Especificaciónes

+ + + + + + + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('HTML WHATWG','scripting.html#the-slot-element','<slot>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('DOM WHATWG','#shadow-tree-slots','Slots')}}{{Spec2('DOM WHATWG')}}
+ +

Compatibilidad de navegadores

+ + + +

{{Compat("html.elements.slot")}}

-- cgit v1.2.3-54-g00ecf