[html5] Understanding HGROUP

Brian Tremblay webmaster at tsmchughs.com
Thu Jun 11 11:11:28 PDT 2015


On 6/11/15 3:13 AM, Tony Crockford wrote:
>> On 11 Jun 2015, at 09:11, Brian Tremblay wrote:
>>
>> I'm not sure how <hgroup><h1><h2> offers anything better
>> practically speaking than <header><h1><p>.
>
> Isn’t it more about how a machine would understand it?

That's my take. It's just that I feel like I would do just fine without 
it. When I first saw <hgroup>, my thinking, like the op, was that it 
just felt wrong to use <h2> in that way. But I started using it anyways, 
switching from:

<header>
  <h1>SV Appliance Repair</h1>
  <div>Professional • Flexible</div>
</header>

to:

<header>
  <hgroup>
   <h1>SV Appliance Repair</h1>
   <h2>Professional • Flexible</h2>
  </hgroup>
</header>


Then I learned that <hgroup> was removed from the standard. So reverted 
to the earlier code. Then I learned that it was only removed from the 
w3c's html standard, and not whatwg's. But I have not re-reverted. I 
don't see what the advantage is, so I have not bothered.

> 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)

I've never done that. Maybe that's why I'm missing the point.

> 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.

Ok. Then <header><h1><h2> would do the job, ISTM.


<header>
  <h1>Flight 222</h1>
  <h2>A journey to Shashamene Land</h2>
</header>


-- 
Brian Tremblay


More information about the Help mailing list