W3C home > Mailing lists > Public > public-html@w3.org > November 2011

Change Proposal to replace hgroup with a simple element

From: Kornel Lesiński <kornel@geekhood.net>
Date: Sun, 06 Nov 2011 23:38:32 -0000
To: public-html@w3.org
Message-ID: <op.v4jtaiexte2ec8@aimac.local>

I agree with Lars Gunther that reuse of <h1-h6> for subheadings causes  
nothing but trouble, and subheadings can be marked up in a more  
straightforward manner.

I'd like to propose a new element that IMHO is much easier to understand  
and use correctly, satisfies all major use cases of <hgroup> and does not  
break outline in legacy UAs.

The proposal is in the wiki:


Change Proposal

    Replace <hgroup> with an element that has a simple content model and  
backwards compatibility.


      * <hgroup> overloads meaning of <h1-h6>, making them either headings  
included in document
        outline or not, depending on context created by hgroup and other  
headings. No other
        element in HTML creates such ambiguous context-dependent meaning.

      * Name and usage of <hgroup> can be confused with <header>, since  
both appear in headers
        and group elements.

      * <hgroup>'s content model disallows adding extra <div>s around  
multiple subheadings, which
        may be needed as styling hooks.

      * Existing content on the web does not use as complex multi-level  
subheadings as <hgroup>
        was intended to support. There is no need to precisely mark up  
levels of subheadings, as
        the whole title is meant to be read in (document) order and  
subheadings are not used for


    <hsub> element is a subheading. It represents a subheading for its  
section (i.e. it is
    associated with the heading in the same section that the <hsub> is in).  
The algorithm for
    associating <hsub> with a section is the same as for <h1-h6>, except  
<hsub> does not imply
    new sections.

    <hsub> element has same content model as <h1-h6>.

    Optionally: <hsub> can be allowed to be nested inside <h1-h6>, which  
allows full title to be
    seen as a header in legacy UAs and makes it easy to style heading and  
subheading using CSS.



  <h1>Second Title</h1>
      <hsub>Second Subtitle 1</hsub>
      <hsub>Second Subtitle 2</hsub>

      <hsub>The Magical</hsub>
      <hsub>That Has</hsub>
      <hsub>Multiple Subtitles</hsub>


    The most common usage of subheadings can be styled simply with h1 +  
hsub CSS selector.
    Authors can make complex headers easier to select by wrapping headings  
and subheadings in
    <header>. Relaxed content model allows "styling hook" elements to be  
added as necessary.

   Authoring errors

    Mistakes in usage of <hsub> cannot break document outline, which is a  
significant improvement
    over <hgroup>.

    At worst, in a rather rare case of subtitle preceeding the title,  
subtitle may end up
    associated with an earlier heading:

  <h1>Unrelated title</h1>

  <hsub>Preceeding subtitle</hsub>

    However, this kind of mistake can be easily eliminated by use of  

    <hsub>Preceeding subtitle</hsub>


    Removal of the <hgroup> element.

regards, Kornel Lesiński
Received on Sunday, 6 November 2011 23:39:08 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:45:45 UTC