English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML <fieldset> marcação localizada dentro da <form> marcação, usada para agrupar elementos relevantes do formulário HTML. Use a <legend> marcação para criar um título para <fieldset>. Este marcador também é conhecido como elemento <fieldset>.
Agrupar elementos relevantes do formulário:
!doctype html <html> <head> <meta charset="UTF-8"> <title>HTML5 Uso da tag <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 ‹/›
O efeito após a execução é o seguinte:
IEFirefoxOperaChromeSafari
Todos os navegadores populares suportam a tag <fieldset>.
O <fieldset> pode agrupar elementos dentro de um formulário.
O <fieldset> cria uma borda ao redor dos elementos de formulário relevantes.
Most browsers will display a black border around the <fieldset> tag, but you can use CSS to change this behavior.
You can use the <legend> tag to display the title of the <fieldset>. This title will be presented before the related form controls within the <fieldset> and will appear floating above the top border of the <fieldset>.
Tip:<legend> The tag defines the title for the <fieldset> element.
HTML5 Some new attributes for <fieldset> have been added: disabled, form, name, HTML 4.01 These attributes are not supported in the middle of the text.
Attribute | Value | Description |
---|---|---|
disabledHTML5 | disabled | Specifies that the form elements in this group should be disabled. |
formHTML5 | form_id | Specifies one or more forms that the fieldset belongs to. |
nameHTML5 | text | Specifies the name of the fieldset. |
Support for <fieldset> tag Global attributes of HTML.
Support for <fieldset> tag HTML event attributes.