W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: <di>? Please?

From: Ambrose LI <ambrose.li@gmail.com>
Date: Sat, 4 Feb 2012 15:24:25 -0500
Message-ID: <CADJvFOVJ3FKoqoetrhZLDeMgy84g6yX5Q5QZhigODLr7i-pz7Q@mail.gmail.com>
To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
Cc: Lea Verou <leaverou@gmail.com>, www-style@w3.org, Hugh Guiney <hugh.guiney@gmail.com>, whatwg <whatwg@whatwg.org>
2012/2/4 Marat Tanalin | tanalin.com <mtanalin@yandex.ru>:
> 04.02.2012, 18:11, "Ambrose LI" <ambrose.li@gmail.com>:
>>
>> I wonít exactly say DIV is non-structural. †There are such things as
>> structural uses of DIV; itís more correct to say itís an HTML
>> container with undefined semantics (defined by conventions) and/or
>> undefined style (defined by stylesheets).
>
> According to HTML5 spec, "the div element has no special meaning at all":
> http://www.w3.org/TR/html5/grouping-content.html#the-div-element
>
> Microformats/microdata are a separate pseudosemantic "layer" that usually rely purely on classes and attributes and don't rely on core HTML semantics like DL/DT parent-child semantic relations, so microformats/microdata do not interfere with what I've said about DIV.

I think we need to go back further, back to a time closer to when DIV was
actually invented. In the HTML 4.01 spec, we read

   The DIV and SPAN elements, in conjunction with the id and class
   attributes, offer a generic mechanism for adding structure to
   documents. These elements define content to be inline (SPAN) or
   block-level (DIV) but impose no other presentational idioms on the
   content. Thus, authors may use these elements in conjunction with
   style sheets, the lang attribute, etc., to tailor HTML to their own
   needs and tastes.

   Suppose, for example, that we wanted to generate an HTML document
   based on a database of client information. Since HTML does not include
   elements that identify objects such as "client", "telephone number",
   "email address", etc., we use DIV and SPAN to achieve the desired
   structural and presentational effects. We might use the TABLE element
   as follows to structure the information:

(Note that ďadding structureĒ was explicitly mentioned. DIV was added
as a generic means to impose arbitrary structure, not mainly to add
styling.)

This was in fact, IIRC, what happened well before the use of
randomly-inserted DIV as a means to do generic styling. I donít
remember the standard documents offhand, but I faintly remember at
least a couple of standards explicitly stating DIV/SPAN + class as the
way to impose structured semantics (that are defined by those
standards) onto textual data in HTML documents. Microformats and
microdata are actually latecomers.

> Independently of the tread subject, if you think P element is currently
> defined incorrectly in HTML5 spec, you probably should report it on W3
> bug tracker.

I donít really think thatís fixable. We need a new element that is
truly structural to begin with that can functionally represent real
paragraphs. BLOCKQUOTE is broken in the same way, but at least that
can theoretically be fixed because its end tag is mandatory.


-- 
cheers,
-ambrose
Received on Saturday, 4 February 2012 22:02:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT