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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <fieldset> Tag

HTML <fieldset>-Markierung liegt innerhalb des <form>-Tags und wird verwendet, um die zugehörigen Elemente in einem HTML-Formular zu gruppieren. Verwenden Sie das <legend>-Markierung, um dem <fieldset> einen Titel zu erstellen. Dieses Markierung wird auch als <fieldset>-Element bezeichnet.

Online-Beispiel

Gruppieren Sie die zugehörigen Elementen im Formular:

!doctype html
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 Verwendung des fieldset-Tags (Grundlagen-Tutorial-Netz oldtoolbag.com)</title>
</head>
<body>
<form>
  <fieldset>
    <legend> Kundeninformationen(oldtoolbag.com)</legend>
    Name: <input type="text"><br>
    Adresse: <input type="text"><br>
    Telefonnummer: <input type="text">
  </fieldset>
</form>
</body>
</html>
Testen Sie es heraus ‹/›

Das Ergebnis nach dem Ausführen ist wie folgt:

Kompatibilität mit Browsern

IEFirefoxOperaChromeSafari

Alle gängigen Browser unterstützen den <fieldset>-Tag.

Definition und Verwendung des Tags

Der <fieldset>-Tag kann die zugehörigen Elemente innerhalb eines Formulars gruppieren.

Der <fieldset>-Tag zeichnet um die zugehörigen Formularelemente eine Umrandung.

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

Hint and Note

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

HTML 4.01 and HTML5Differences between

HTML5 New attributes added to <fieldset> in HTML: disabled, form, name, HTML 4.01 These attributes are not supported in Chinese.

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.