[whatwg] Question on (new) header and hgroup

Tab Atkins Jr. jackalmage at gmail.com
Thu May 7 17:03:38 PDT 2009


On Thu, May 7, 2009 at 3:34 PM,  <jgraham at opera.com> wrote:
> Quoting Smylers <Smylers at stripey.com>:
>
>> James Graham writes:
>>
>>> Bruce Lawson wrote:
>>>
>>> > I'm struggling to understand the reasons for <hgroup>: wouldn't one
>>> > or more h1..h6 elements wrapped in the same <header> imply just such
>>> > a grouping without the need for such an element?
>>>
>>> <hgroup> affects the document structure, <header> does not.
>>
>> That explains _how_ they are different (as does the spec), but not _why_
>> it is like that.
>>
>> More specifically:
>>
>> * Are there significant cases where <header> needs _not_ to imply
>>  <hgroup>?  Consider wrapping an <hgroup> inside every <header>; how
>>  many places has that broken the semantics?  I could believe that most
>>  of the cases where a pager header appropriately contains multiple
>>  headings they are subtitles rather than subsections.
>
> The semantic that authors seem to want from an element named "header" is
> "All the top matter of my page before the main content". That could include
> headers, subheaders, navigation, asides (at least per the current definition
> of aside which I think is silly, but I digress) and almost anything else.
> Since the <header> can contain multiple distinct logical sections of the
> document, each with their own headers, it makes no sense to implicitly wrap
> its contents in <hgroup>.

James got it exactly.  I, as an author, want an element that fills a
role analogous to <article> in semantics, so I can trivially and
obviously mark up that the section is just a prelude to my main
content.

In my own pages, when I use a <div #header>, it usually contains, in
addition to the heading itself, some non-heading text and a nav or
two.  That latter bit especially would be inappropriate within an
(implicit) <hgroup>.

>> * Are there significant cases where <hgroup> will be useful outside of
>>  <header>?
>>
>>  <hgroup> exists to allow for subtitles and the like.  It's fairly
>>  common for documents to have these -- where it's likely there's use
>>  for a <header> element anyway.
>>
>>  It's much less common for a mere section of a document to warrant a
>>  multi-part title; is that a case which is worth solving?  If it is,
>>  would it be problematic to force authors to use <header> there?
>
> It seems highly odd to have <header> perform a dual role where sometimes it
> means "section header" and sometimes it means "group of heading/subheading
> elements". Much more confusing than one element per role.

Section headers with subtitles lower down in the document hierarchy
occur with a decent frequency in my pages.  The document itself would
have a complex <header> (possibly with an <hgroup>), then the
<article> would have an <hgroup> of its own.

~TJ


More information about the whatwg mailing list