[whatwg] List captions

On 4/6/07, Elliotte Harold <elharo at metalab.unc.edu> wrote:
> Andy Mabbett wrote:
> > How often do we see something like:
> >
> >         <p>Animals:</p>
> >         <ul>
> >           <li>Cat</li>
> >           <li>Dog</li>
> >           <li>Horse</li>
> >           <li>Cow</li>
> >         </ul>
> >
> > This would be more meaningful as:
> >
> >         <ul caption="Animals">
> >           <li>Cat</li>
> >           <li>Dog</li>
> >           <li>Horse</li>
> >           <li>Cow</li>
> >         </ul>
> >
>
> No, the caption should be displayed to all users. That means it needs to
> be element content, not an attribute value. Just maybe
>
>          <ul>
>            <caption>Animals</caption>
>            <li>Cat</li>
>            <li>Dog</li>
>            <li>Horse</li>
>            <li>Cow</li>
>          </ul>

Seems to me that what you want semantically is:

<dl>
  <dt>Animals</dt>
  <dd>Cat</dd>
  <dd>Dog</dd>
  <dd>Horse</dd>
  <dd>Cow</dd>
</dl>

or maybe

<dl>
  <dt>Animals</dt>
  <dd><ul>
  <li>Cat</li>
  <li>Dog</li>
  <li>Horse</li>
  <li>Cow</li>
  </ul></dd>
</dl>

if you're feeling XOXO-esque

Received on Tuesday, 10 April 2007 17:20:12 UTC