Re: suggestion for abolition of <hgroup>

On Fri, 24 Dec 2010, James Clark wrote:
> 
> The aspect of <hgroup> that I suspect will cause problems is the 
> mechanism for identifying the child of the <hgroup> that is the main 
> heading (ie the one that contributes to the outline).  The problem is 
> that you are often going to want to treat this child specially, eg for 
> styling or for transformations, and the rules that the spec describes 
> for identifying this child are relatively complex -- the first from 
> amongst those children with the highest rank. In particular, I can't 
> think of a way to write a CSS selector for this, and the only ways I can 
> think of to write an XPath expression for this are very hairy.

For this markup:

   <hgroup>
    <h1>HTML</h1>
    <h2>A markup language for the Web</h2>
   </hgroup>

...a rule to style the subheading would be:

   hgroup > h2 { ... }

In practice there's no need for a generic solution since the author of the 
CSS also controls the markup.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Sunday, 26 December 2010 07:10:47 UTC