XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / legend

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

legend

HTML 4.01 | HTML 5

<legend> ... </legend>

Provides a heading for a group of form fields marked with fieldset. For this purpose, legend must be the first child element of fieldset. This improves accessibility when a fieldset is to be presented nonvisually, for example by a speech synthesizer or a Braille display.

Start/end tag

Required/required

Attributes

Core, internationalization, events, global HTML 5 attributes

  • accesskey="character"

    Assigns a specific keyboard shortcut to an element for easier access.

  • align="top|bottom|left|right"

    Deprecated. Not in HTML 5. Aligns the text relative to fieldset.

Example

<fieldset>
  <legend>Newsletter abonnieren</legend>
  <ul>
    <li><label>Schicken Sie mir Ihren Newsletter zu <input type="radio" name="liste"></label></li>
    <li><label>Nein danke <input name="liste" value="nein"></label></li>
  </ul>
</fieldset>

 

> back to the alphabetical list of elements

   

 

 

 

back to top