E-mail List Archives
Re: RE: Long form legends
From: Jukka K. Korpela
Date: Jun 10, 2005 2:03PM
- Next message: Richard Garbutt: "Re: Long form legends"
- Previous message: Richard Garbutt: "Re: RE: Long form legends"
- Next message in Thread: Richard Garbutt: "Re: Long form legends"
- Previous message in Thread: Richard Garbutt: "Re: RE: Long form legends"
- View all messages in this Thread
On Sat, 4 Jun 2005, Richard Garbutt wrote:
> This tutorial:
>
> http://www.picment.com/articles/css/funwithforms/
>
> seems great on styling forms. I like the way they mark them up:
>
> <code>
> <form>
> <fieldest>
> <label for="foo">foo</label>
> <input id="foo" type="text" name="foo" />
> </fieldset>
> </form>
> </code>
Unfortunately, that's invalid markup, and I don't mean just the
misspelling <fieldest> for <fieldset>. Contrary to what the cited document
claims, the <legend> element is _not_ optional. It is required by HTML
syntax, see
http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.10
(Even the spec is misleading: it says that "The LEGEND element allows
authors to assign a caption to a FIELDSET", but by the formal syntax,
<legend> is required.)
I don't think <fieldset> is particularly useful for a _single_ field. It's
useful for a _group_ of interrelated radio buttons and their captions, for
example.
Note: <legend></legend> would satisfy the syntax requirement, but it may
confuse people who use browsers that speak the legend.
--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
- Next message: Richard Garbutt: "Re: Long form legends"
- Previous message: Richard Garbutt: "Re: RE: Long form legends"
- Next message in Thread: Richard Garbutt: "Re: Long form legends"
- Previous message in Thread: Richard Garbutt: "Re: RE: Long form legends"
- View all messages in this Thread