[html5] Understanding HGROUP

Ian Hickson ian at hixie.ch
Thu Jun 11 11:15:09 PDT 2015


On Thu, 11 Jun 2015, Brian Tremblay wrote:
> On 6/11/15 12:02 AM, Matthew Jelenic wrote:
> > 
> > we have a piece of information that we want to keep with the heading, 
> > as it is associated, but the item isn't important enough to appear in 
> > the document outline. Isn't this a job for our friend Mr <Header>? >
> > 
> >     <header>
> >         <h1>The reality dysfunction</h1>
> >         <p>Space is not the only void</p>
> >     </header>
> > 
> > It's semantically clear that the two are parts of a larger header 
> > unit/title information.... Also, the outline is what we would expect.

Continuing from the "The reality dysfunction" example:

"The reality dysfunction" is a book. You can think of <header> as being 
"the book cover", and <h1> as being "the book title". But it turns out 
that (the first edition of) "The reality dysfunction" has two titles.

There are other things on the book cover, though. The page author, a quote 
from a review, the publisher's name. Those things are paragraphs, not 
headings.

That is why you might want to distinguish the heading(s) from the other 
text on the header. They're conceptually different.


> IMHO, there's nothing wrong with that markup.

Yeah, using a <p> and <header> would work too. I wouldn't stress too much 
over it. Use whichever seems most useful in your case.


> > it feels like the <h2> in the WHATWG comes from a desire to quickly 
> > style, not because it's the most appropriate tag.
> 
> It's not for style purposes. It is to replace the empty semantics of 
> <div class="heading"> and <div class="subhead">.

Yeah. There's more to it than just styling. But of course, being able to 
easily style it is also a big part of it.


> To be fair to your question, I'm not sure of the usefulness of several 
> new elements. I think there's a certain bit of "we see <div class="foo"> 
> on lots of pages, let's create element <foo> to replace it".


> The most pointless, to me, is <main>. I have no idea what it's supposed 
> to do. My page has main content. It's everything that's not <nav> and 
> not <aside>.

I agree. <main> was added because browsers implemented it, so it was 
essentially free to add. (It was added by browsers because of discussions 
in the W3C, as I understand it.)


On Thu, 11 Jun 2015, Tony Crockford wrote:
> 
> e.g. elements within an hgroup are titles/headings and can be parsed as 
> such by a machine to translate the document to another form. (a database 
> object for example) whereas the contents of a header element could be 
> headings, or logos or just metadata about the section… - a bit too vague 
> to machine interpret.

That's one of the non-style uses for it, yes.

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


More information about the Help mailing list