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

Re: DIV as an inline container

From: Robert Burns <rob@robburns.com>
Date: Sat, 4 Aug 2007 07:39:18 -0500
Message-Id: <5F763B4A-C872-47F7-9180-CA2F6EE8BB4E@robburns.com>
Cc: "HTML WG" <public-html@w3.org>
To: liorean <liorean@gmail.com>

On Aug 4, 2007, at 4:53 AM, liorean wrote:

>
> On 04/08/07, Robert Burns <rob@robburns.com> wrote:
>> I don't see any problem with DIV with a strictly inline-level or
>> inline-level content. Right now the draft says:
>>
>> "followed by either zero or more block-level elements, or inline-
>> level content (but not both)."
>>
>> So what's wrong with inline level content? Historically,, DIV has
>> either been used as either 1) a sectioning element (block-level /
>> structural only); or 2) as a more flexible P element (structural
>> inline-level or strictly inline-level). With our current draft, I
>> think the sectioning elements practically remove any need for DIV in
>> the first role. SECTION seems generic enough for any way DIV might
>> have been used as a generic in that way. That only leaves DIV as an
>> inline container (structural or strict). In some ways DIV could just
>> serve the content model need of P for the text/html serialization.
>> The semantic space left for DIV is really not any broader than that
>> for P (in the XML serialization). We could even add a minimized
>> boolean to DIV to declare this paragraph usage, for example:
>>
>>   <div p>My structural inline-level paragraph content</div>.
>
> Well, first of all that would make many valid HTML4 documents invalid
> HTML5 documents.

How so? There would be no requirement that a DIV have this boolean  
set. It could just as well be:

   <div>My structural inline-level paragraph content</div>.

or

<p>My strictly inline-level paragraph content</p>.

both of which are HTML4 valid.

>
> Second, the way I understood the intent of adding the section element
> is that section is a content grouping mechanism primarily for giving
> related text an explicit grouping instead of as is the case with the
> h# elements in HTML4*. The div element on the other hand is also a
> content grouping mechanism but it doesn't have any explicit grouping
> purpose, textual or otherwise. The grouping purpose is given to it by
> it's usage - such as class or id attributes for styling or scripting,
> attaching events to it, or simply the effects on the DOM tree from the
> div being there, etc.

Yes, certainly that's true. However, my point was that after  
establishing HEADER, FOOTER, NAV, ASIDE and SECTION, there's very  
little left for DIV to do in this area (that it did or does  
historically). There still might be a small niche here for a generic  
sectioning element  one that doesn't get involved in the outline  
mechanism  but that's a small role. It could be covered by DIV  
without the @p boolean set. Or a DIV with a @section boolean set. Or  
whatever.

In any event, the sectioning elements create very little need for DIV  
with a block content model. Almost the only role left for DIV is as  
an inline container. That was the point of my post: to defend the use  
of DIV with an inline content model. I don't think a document  
containing DIV with an inline content model should be considered a  
low-quality document.

Take care,
Rob
Received on Saturday, 4 August 2007 12:39:34 UTC

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