aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/html/element/legend/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/es/web/html/element/legend/index.html')
-rw-r--r--files/es/web/html/element/legend/index.html126
1 files changed, 126 insertions, 0 deletions
diff --git a/files/es/web/html/element/legend/index.html b/files/es/web/html/element/legend/index.html
new file mode 100644
index 0000000000..1ad33e3359
--- /dev/null
+++ b/files/es/web/html/element/legend/index.html
@@ -0,0 +1,126 @@
+---
+title: legend
+slug: Web/HTML/Element/legend
+tags:
+ - HTML
+ - HTML:Elemento
+ - Todas_las_Categorías
+translation_of: Web/HTML/Element/legend
+original_slug: Web/HTML/Elemento/legend
+---
+<h3 id="Definici.C3.B3n" name="Definici.C3.B3n">Definición</h3>
+
+<p>El elemento <span style="font-family: courier new;">&lt;legend&gt;</span> (leyenda) crea un título para un grupos los campos ({{ HTMLElement("fieldset") }}) de un formulario.</p>
+
+<dl>
+ <dd><strong>Sus etiquetas son</strong>: <span style="font-family: courier new;">&lt;legend&gt;</span> y <span style="font-family: courier new;">&lt;/legend&gt;</span> (ambas obligatorias).</dd>
+</dl>
+
+<dl>
+ <dd><strong>Crea una caja</strong>: <a href="/es/HTML/Elemento/Tipos_de_elementos#en_bloque" title="es/HTML/Elemento/Tipos_de_elementos#en_bloque">en bloque</a></dd>
+</dl>
+
+<dl>
+ <dd><strong>Está definido como</strong>:</dd>
+</dl>
+
+<dl>
+ <dd><strong>Debe contener</strong>: cero o más elementos <a href="/es/HTML/Elemento/Tipos_de_elementos#en_linea" title="es/HTML/Elemento/Tipos_de_elementos#en_linea">en linea</a></dd>
+ <dd><strong>Debe estar contenido por</strong>: debe ser el primer hijo de un elemento {{ HTMLElement("fieldset") }}</dd>
+</dl>
+
+<h4 id="Atributos" name="Atributos">Atributos</h4>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th>Atributo</th>
+ <th colspan="2">valor</th>
+ <th>descripción</th>
+ </tr>
+ <tr>
+ <th colspan="4">Genéricos</th>
+ </tr>
+ <tr>
+ <td><code style="color: green;">title</code></td>
+ <td>texto</td>
+ <td>implícito</td>
+ <td>título consultivo del elemento.</td>
+ </tr>
+ <tr>
+ <td><code style="color: green;">style</code></td>
+ <td>reglas de estilo</td>
+ <td>implícito</td>
+ <td>información de estilo en línea.</td>
+ </tr>
+ <tr>
+ <td><code style="color: green;">id</code></td>
+ <td>ID</td>
+ <td>implícito</td>
+ <td>identificador único a nivel de documento.</td>
+ </tr>
+ <tr>
+ <td><code style="color: green;">class</code></td>
+ <td>lista de clases separadas por espacios</td>
+ <td>implícito</td>
+ <td>identificador a nivel de documento</td>
+ </tr>
+ <tr>
+ <td><code style="color: green;">dir</code></td>
+ <td>uno de los siguientes:"ltr" o "rtl"</td>
+ <td>implícito</td>
+ <td>dirección del texto débil/neutral</td>
+ </tr>
+ <tr>
+ <td><code style="color: green;">lang</code></td>
+ <td>código de idioma</td>
+ <td>implícito</td>
+ <td>información sobre el idioma</td>
+ </tr>
+ <tr>
+ <td colspan="4"><strong>Eventos</strong>: <code style="color: green;">onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.</code></td>
+ </tr>
+ <tr>
+ <th colspan="4">Específicos</th>
+ </tr>
+ <tr>
+ <td><code style="color: green;">accesskey</code></td>
+ <td>un caracter</td>
+ <td>implícito</td>
+ <td>carácter de la tecla de acceso rápido</td>
+ </tr>
+ <tr>
+ <th colspan="4">de transición</th>
+ </tr>
+ <tr>
+ <td><code style="color: green;">align</code></td>
+ <td>uno de los siguientes: "top", "bottom", "left" o "right"</td>
+ <td>implícito</td>
+ <td>alineación con relación al fieldset</td>
+ </tr>
+ <tr>
+ <th>Atributo</th>
+ <th colspan="2">valor</th>
+ <th>descripción</th>
+ </tr>
+ </tbody>
+</table>
+
+<h3 id="Ejemplos" name="Ejemplos">Ejemplos</h3>
+
+<pre>&lt;form&gt;
+ &lt;fieldset&gt;
+ &lt;legend&gt;Información Personal&lt;/legend&gt;
+ &lt;label for="nombre"&gt;Nombre:&lt;/label&gt;
+ &lt;input name="nombre" id="nombre" type="text" tabindex="1" /&gt;
+ &lt;label for="apellidos"&gt;Apellidos:&lt;/label&gt;
+ &lt;input name="apellidos" id="apellidos" type="text" tabindex="2" /&gt;
+ &lt;/fieldset&gt;
+
+ &lt;fieldset&gt;
+ &lt;legend&gt;Edad&lt;/legend&gt;
+ &lt;label&gt;&lt;input type="checkbox" tabindex="20" name="edad" value="20-39" /&gt; 20-39&lt;/label&gt;
+ &lt;label&gt;&lt;input type="checkbox" tabindex="21" name="edad" value="40-59" /&gt; 40-59&lt;/label&gt;
+ &lt;label&gt;&lt;input type="checkbox" tabindex="22" name="edad" value="60-79" /&gt; 60-79&lt;/label&gt;
+ &lt;/fieldset&gt;
+&lt;/form&gt;</pre>