English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Quando os itens relacionados em um formulário HTML são agrupados, o rótulo HTML <legend> é usado para gerar o título para o rótulo <fieldset>. Este rótulo também é conhecido como elemento <legend>.
Elementos relacionados no formulário combinado:
!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML5 Uso do rótulo <fieldset> (Tutorial básico da Web oldtoolbag.com)</title> </head> <body> <form> <fieldset> <legend>Informações do cliente(oldtoolbag.com)</legend> Nome: <input type="text"><br> Endereço: <input type="text"><br> Número de telefone: <input type="text"> </fieldset> </form> </body> </html>Teste e veja ‹/›
Neste HTML5No exemplo de documento, criamos um marcador <legend> que fornece um título para três grupos de controles <input>. O marcador <legend> será exibido acima desses controles de grupo, mostrando o título "Informações do cliente (oldtoolbag.com)”。
IEFirefoxOperaChromeSafari
Most web browsers support the <legend> tag at present.
The <legend> element is <fieldset>element defines the title.
The title generated by the <legend> tag will be presented before the relevant form controls within the <fieldset> and will appear to float above the top border of the <fieldset>.
In HTML 4.01The "align" attribute has been deprecated, HTML5This attribute is not supported. Not recommended for use. Use CSS to set the alignment of the <legend> element.
Attribute | Value | Description |
---|---|---|
align | top bottom left right | HTML5 Not supported. HTML 4.01 Deprecated. Not recommended for use. Use styles instead. Define alignment for the title within fieldset. |
<legend> tag supports global attributes, see the complete attribute table HTML global attributes.
<legend> tag supports all HTML event attributes.