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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <legend> Tag

Wenn HTML-Formularfelder gruppiert werden, wird das HTML- <legend>-Markenzeichen verwendet, um dem <fieldset>-Markenzeichen einen Titel zu erstellen. Dieses Markenzeichen wird auch als <legend>-Element bezeichnet.

Online-Beispiel

Kombinierte Formularelemente:

!doctype html
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 Die Verwendung des <fieldset>-Tags (Grundtutorialsnetz w3(codebox.com)</title>
</head>
<body>
<form>
  <fieldset>
    <legend>Kundeninformationen(w3(codebox.com)</legend>
    Name: <input type="text"><br>
    Adresse: <input type="text"><br>
    Telefonnummer: <input type="text">
  </fieldset>
</form>
</body>
</html>
Testen Sie, um zu sehen ‹/›

In diesem HTML5In der Dokumentation haben wir ein <legend>-Markenzeichen erstellt, das den Titel für die drei Gruppen der <input>-Steuerungen bereitstellt. Das <legend>-Markenzeichen wird über diesen Gruppensteuerungen angezeigt und zeigt den Titel "Kundeninformationen(w"3(codebox.com)。

Browser-Kompatibilität

IEFirefoxOperaChromeSafari

Most web browsers currently support the <legend> tag.

Tag definition and usage instructions

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

HTML 4.01 with HTML5differences

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

AttributeValueDescription
aligntop
bottom
left
right
HTML5 Not supported. HTML 4.01 Deprecated. Not recommended for use. Use styles instead. Define the alignment for the title within the fieldset.

Global Attributes

<legend> Tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<legend> Tag supports all HTML Event Attributes.