W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2007

[whatwg] List captions

From: Thomas Broyer <t.broyer@gmail.com>
Date: Fri, 6 Apr 2007 16:57:57 +0200
Message-ID: <a9699fd20704060757m381b767fyce5440105c579e50@mail.gmail.com>
2007/4/6, Andy Mabbett:
> >
> >We should do our best to avoid repeats of alt, title, and friends.
>
> Why?

Styling, text extraction (a.k.a. tag-stripping)

> >A list  header would go much better as a separate element, like
> ><caption> is for  tables.
>
> Like:
>         <ul>
>           <caption>Animals</caption> (or lh, or whatever)
>           <li>Cat</li>
>           <li>Dog</li>
>           <li>Horse</li>
>           <li>Cow</li>
>         </ul>
>
> Yes, that would work, too.

Problem: not backwards compatible (w.r.t. styling)
See this page with different browsers:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cbody%3E%0A%3Cstyle%20type%3D%22text/css%22%3Eul%20caption%20%7B%20text-decoration%3A%20underline%3B%20%7D%3C/style%3E%0A%3Cul%3E%3Clh%20style%3D%22color%3A%20green%22%3ECaption%3C/lh%3E%3Cli%3EItem%201

You can also try with <lh>, almost same results (much better in Firefox).
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0D%0A%3Cbody%3E%0D%0A%3Cstyle%20type%3D%22text/css%22%3Eul%20lh%20%7B%20text-decoration%3A%20underline%3B%20%7D%3C/style%3E%0D%0A%3Cul%3E%3Clh%20style%3D%22color%3A%20green%22%3ECaption%3C/lh%3E%3Cli%3EItem%201

Better results with <p>, but not semantically a good choice.

Using an <ul> or <ol> nested inside a <dl> is not that bad after all...

-- 
Thomas Broyer
Received on Friday, 6 April 2007 07:57:57 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:54 UTC