Definition lists

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Suppose you had a single key-value pair - would you use a definition
list to mark that up? For example:

        <dd>Jane Smith</dd>

Of course a list can have just one item in it, but is something that can
only ever have one item in it still a list?


Re: Definition lists (D.M. Procida) writes:
Quoted text here. Click to load it

  Actually, this is the only way to write a relation between a
  definition term and a definition datum in a non-ambiguous way
  using HTML 4.01, because for more elements, such as in


  , the HTML 4.01 specification does not say whether "<dt>a</dt>"
  is the definition term for "<dd>b</dd>" or "<dd>d</dd>", see:

Re: Definition lists

Scripsit Stefan Ram:

Quoted text here. Click to load it

That might be true in a relatively irrelevant sense.

To the extent that it is true, it proves that the markup is semantically
completely wrong, since this is not about defining the term "director".

As explained in detail at ,
there is no adequate markup for definitions in HTML. Just don't try too
hard, and try to write markup that _otherwise_ makes sense.

If you wish to present filmographic information, for example, using a
table is quite adequate, both logically and for rendering purposes. You
can use <th> markup for header-like things like "Director" and <td> for
data cells. Just use CSS to make <th> element content left-aligned.

(IMDb uses more contrived and less logical markup, so they have to take
extra trouble to make the stuff _look_ like a table. "Tableless design"
is absurd when your data contains tabular data!)

Jukka K. Korpela ("Yucca")

Site Timeline