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

Re: DIV as an inline container

From: liorean <liorean@gmail.com>
Date: Sat, 4 Aug 2007 11:53:17 +0200
Message-ID: <cee13aa30708040253l26a07f37qc5bdefab21ba471e@mail.gmail.com>
To: "HTML WG" <public-html@w3.org>

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.

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.

*  After you've used a heading, you cannot make a paragraph not belong
under that heading in the outline mechanism for HTML4 without giving
it another heading of equivalent rank or better. You can do that if
you wrap headings and paragraphs with section elements in HTML5.
-- 
David "liorean" Andersson
Received on Saturday, 4 August 2007 09:53:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:03 GMT