Sets and legends

Ok, I know how fieldset/ works legendin HTML. Let's say you have a form with several fields:

<form>
    <fieldset>
        <legend>legend</legend>
        <input name="input1" />
    </fieldset>
</form>

What should I use for legend? It appears as title , but is the legend semantically an explanation of the content? In my opinion, it is advisable that you do something like this:

<form>
    <fieldset>
        <legend>* = required</legend>
        <label for="input1">input 1 *</label><input id="input1" name="input1" />
    </fieldset>
</form>

But this does not work with field visualization. Is this just an ambiguous name in HTML, or is it my misunderstanding of the English word "legend"?


Edit: fixed some bugs; -)

+5
source share
5 answers

Yes, the naming is ambiguous. It’s best to consider it as a heading for a set of fields.

HTML FIELDSET LEGEND, :

LEGEND FIELDSET. , FIELDSET .

+8

,

<form>
    <fieldset>
        <legend>legend</legend>
        <input name="input1" />
    </fieldset>
</form>

. ,

  • , .
  • .

, .

+1

, " "... , , CSS. CSS , , .

, ... , - - "* = required" ( , ).

, , , ( , ).

, CSS ( ) .

+1

. . " " " ".

:

Skiviez Checkout http://piasecki.name/fieldset-legend-example.jpg

CSS ( Internet Explorer . IE , " ".

+1

<legend> "" "" , <fieldset>.

FIELDSET

, fieldset , <input> <legend>.

<div> s, <p> s <li> <input> + <legend>.

+1

All Articles