[CSS3] Generated and Replaced Content - Grouping (long, examples)

I've posted this in c.i.w.a.s. group but I've decided to post it 
here, too, to find out what the people from the WG think about it.

Looking through the draft I still can't figure out how one could (is 
it possible to) group several elements and style a generated 
containing block for the group. This is much similar to a typical 
HTML structure:

<H1>
   <P>
   <H2>
     <P>
     <H3>
       <P>
   <H2>
     <P>
     <P>

So an application processing this document would "generate" the 
following containers: one containing the H1 element and everything 
bellow, a nested containers for the two H2 elements grouped with 
elements following them (delimited by the appearance of the H2 
elements), etc. I say "generate" because an application is not 
necessary to display the document but only to process the data and 
generate an outline (for internal processing use) with the specified 
algorithm.

A similar case is with the definition list and DT and DD elements in 
HTML:

<DL>
   <DT>
   <DD>
   <DT>
   <DD>
</DL>

This is not very good example because one could use multiple DL 
elements - one for each DT grouped with related DDs, but it would be 
nice if CSS could select a DT element grouped with all next (DD) 
elements till reaching next DT element and generate a box to apply 
some formatting.

I'm mainly interested in this because many times I have to put 
additional elements which not necessary delimit logical sections but 
are put so they could be styled. An example:

<HEADER/>
<CONTENT/>
<FOOTER/>

So if I want to style the "content" and the "footer" to show a right 
border I put:

<HEADER/>
<GENERIC>
  <CONTENT/>
  <FOOTER/>
</GENERIC>

So I could style the "generic" showing right border. May be some 
would argue that I could put right border on both "content" and 
"footer", but then they are really separate boxes and I want the 
"generic" element box - its height is different which plays 
important role in positioning, etc.

If CSS propose extended syntax for specifying such groupings I 
wouldn't need to put such extra markup and I would easily group the 
"header" and "content" lately when I change my mind about the 
general layout.

What do you think or have I missed something from the spec?

-- 
Stanimir

Received on Thursday, 30 October 2003 10:42:52 UTC