English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de referência HTML

大全 de tags HTML

HTML: <fieldset> etiqueta

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>.

Exemplo online

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:

Compatibilidade do navegador

IEFirefoxOperaChromeSafari

Todos os navegadores populares suportam a tag <fieldset>.

Definição e instruções de uso da 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>.

Tips and notes

Tip:<legend> The tag defines the title for the <fieldset> element.

HTML 4.01 and HTML5Differences between

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

AttributeValueDescription
disabledHTML5disabledSpecifies that the form elements in this group should be disabled.
formHTML5form_idSpecifies one or more forms that the fieldset belongs to.
nameHTML5textSpecifies the name of the fieldset.

Global attributes

Support for <fieldset> tag Global attributes of HTML.

Event attributes

Support for <fieldset> tag HTML event attributes.