W3C Drops ‘hgroup’ Tag From HTML5 Spec
If you’ve been using the HTML5
hgrouptag, now would be a good time to stop. The
hgrouptag is in the process of being removed from the W3C’s HTML5 specification.
While the official reason for
hgroup‘s demise is the lack of support for hgroup semantics — the W3C requires two “reasonably complete implementations” —
hgroup is fraught with accessibility problems and lacks many compelling use cases.
hgroup tag was intended to be a way to group h1-h6 tags, for example a header and a subheading, but the semantics behind the tag mean that only the first header in an
hgroup is visible to any accessibility API. As Steve Faulkner, co-editor of the HTML5 spec, writes on the W3C mailing list, this “effectively removes any notion of a subheading semantic for users and any way for it to be conveyed via an accessibility API.”
In other words
hgroup ends up being semantically no different than a div tag, which is why Faulkner called for
hgroup to be removed from the spec in the first place. As of this writing it’s still there, but Faulkner says he’s “working on the edits” (which will include some advice on how to handle groups of header tags).
So what should you do if you’ve used
hgroup in your code? Well, if you can, consider removing it. But the browser support — which is limited to parsing and CSS — won’t likely change. And it’s also possible that some compelling use case will come up that motivates the W3C to add it to the HTML 5.1 spec (one hopes with better semantic rules) and browser to support it. In the mean time though, slowly step away from the
hgroup and no webpages get hurt.