W3C home > Mailing lists > Public > public-html@w3.org > April 2007

Re: [suggestion] Allow DIV inside any element

From: Schalk Neethling <schalk@alliedbridge.com>
Date: Sun, 29 Apr 2007 23:49:47 +0200
Message-ID: <463512FB.6090202@alliedbridge.com>
To: Bruce Lawson <bruce.c.lawson@gmail.com>
CC: Marat Tanalin <mtanalin@yandex.ru>, public-html@w3.org

Hi everyone,

In this regard why not have classes to identify each dt or li?

<dl>
        <dt class="dt-one">lorem</dt>
        <dd class="dt-one">ipsum</dd>

        <dt class="dt-two">dolor</dt>
        <dd class="dt-two">sit</dd>
</dl>

<ul>
        <li class="style1">lorem</li>
        <li class="style2">ipsum</li>
        <li class="style3">dolor</li>
        <li class="style4">sit</li>
</ul>

Bruce Lawson wrote:
>
> I support this.
> Today I've been trying to style a definition list, and need to wrap 
> each term and its definition(s). A span is illegal, a div is illegal.
>
> bruce
>
>
> At 18:19 29/04/2007, Marat Tanalin wrote:
>
>> Hi to all HTML WG Members.
>>
>> I suggest to allow using DIV element inside any element (probably except
>> tables).
>>
>> It's necessary in order to make code more _semantic_. Let assume that we
>> have definition list:
>>
>> <dl>
>>         <dt>lorem</dt>
>>         <dd>ipsum</dd>
>>
>>         <dt>dolor</dt>
>>         <dd>sit</dd>
>> </dl>
>>
>> Currently, if we want to group each pair DT/DD (mainly to apply 
>> styles to
>> each DT/DD _pair_) we have to use own DL for each pair:
>>
>> <dl>
>>         <dt>lorem</dt>
>>         <dd>ipsum</dd>
>> </dl>
>>
>> <dl>
>>         <dt>dolor</dt>
>>         <dd>sit</dd>
>> </dl>
>>
>> But sequence of DLs where each one contains only one DT/DD pair is not
>> semantic equivalent of one DL that contains several DT/DD pairs.
>>
>> Another example, unordered list:
>>
>> <ul>
>>         <li>lorem</li>
>>         <li>ipsum</li>
>>         <li>dolor</li>
>>         <li>sit</li>
>> </ul>
>>
>> Currently, if we want to _visually_ present list as several lists 
>> (just two
>> cols or any another case), we have to _break_ one list to several
>> _different_ lists:
>>
>> <ul>
>>         <li>lorem</li>
>>         <li>ipsum</li>
>> </ul>
>> <ul>
>>         <li>dolor</li>
>>         <li>sit</li>
>> </ul>
>>
>> Again, sequence of ULs is not equivalent of one UL. It's clear.
>>
>> Making DIV possible to use inside any element solves this problem. For
>> example in case of DL:
>>
>> <dl>
>>         <div>
>>                 <dt>lorem</dt>
>>                 <dd>ipsum</dd>
>>         </div>
>>         <div>
>>                 <dt>dolor</dt>
>>                 <dd>sit</dd>
>>         </div>
>> </dl>
>>
>> ....or UL:
>>
>> <ul>
>>         <div>
>>                 <li>lorem</li>
>>                 <li>ipsum</li>
>>         </div>
>>         <div>
>>                 <li>dolor</li>
>>                 <li>sit</li>
>>         </div>
>> </ul>
>>
>> One semantic list and several divisions inside -- _without breaking
>> semantics_ unlike current approach.
>>
>> DIV is _common_ (with no any semantic sense) container element to apply
>> styles, so let's make it full truth since there is _no_ real reasons to
>> forbid DIVs inside DL, UL, etc. while it make sense to use DIVs 
>> inside any
>> element as it illustrated above.
>>
>> Thanks.
>>
>> -- 
>> Marat Tanalin
>
>
>
>
Received on Sunday, 29 April 2007 21:49:56 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:43 UTC