W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2012

Re: [whatwg] Suggest making <dt> and <dd> valid in <ol>

From: Ian Yang <ian.html@gmail.com>
Date: Sat, 14 Jul 2012 23:53:32 +0800
Message-ID: <CAFhBhuPwi4AL1muyRZOiodjcvOEcLNJbYzDt+xaLPoGk4kNT9g@mail.gmail.com>
To: whatwg@whatwg.org
Okay, it seems that one of the ideas I mentioned in my original email needs
to be revamped.

I was saying that using general heading (<H1>) and paragraph (<p>) loses
the meaning of "definition term" and "definition description", but I didn't
realize that using <ol> loses the meaning of "definition list". That is,
the following code is, in fact, improper:

<!-- The following code is improper as it loses the meaning of "definition
list". -->
<ol>
    <li>
        <dt></dt>
        <dd></dd>
    </li>
    <li>
        <dt></dt>
        <dd></dd>
    </li>
    <li>
        <dt></dt>
        <dd></dd>
    </li>
</ol>


2012/7/14 Anne van Kesteren <annevk@annevk.nl>

> I believe it was added to the specification for the kind of question
> that came up here. The "why do we have <ul> and <ol> but not <dl> and
> <odl>?" question.
>

That's a good idea. Thank you :)

********************

So based on the <ul> and the <ol>, we could have unordered definition list (
<udl>) and ordered definition list (<odl>).

When contents of a definition list are unordered, we could use:

<udl>
    <li>
        <dt></dt>
        <dd></dd>
    </li>
    <li>
         <dt></dt>
         <dd></dd>
     </li>
    <li>
         <dt></dt>
         <dd></dd>
     </li>
</udl>

And when contents of a definition list are ordered, we could use:

<odl>
    <li>
        <dt></dt>
        <dd></dd>
    </li>
    <li>
         <dt></dt>
         <dd></dd>
     </li>
    <li>
         <dt></dt>
         <dd></dd>
     </li>
</odl>


Sincerely,
Ian Yang
Received on Saturday, 14 July 2012 15:53:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:09 GMT