On HTML5 and the proposed main element

←Back to listing

As many of you probably already know, the HTML5 specification has a number of new structural elements whose intention is to add more semantic meaning to the content of a HTML document. One of the elements that some claim to be missing is a main element that would indicate the main content of a document. This might be about to change.

Steve Faulkner of accessibility consultants The Paciello Group has written a HTML5 extension specification proposing a main element to be added to HTML5.

Scooby Doo, where are you?

When repeatedly asked in the past about the need for an element that would identify a document’s main content, the former editor of the HTML5 specification, and current editor of HTML the living standard, Ian Hixie, claimed that it was unnecessary as the start of the main content can be deduced by eliminating all the other content that’s contained within elements such as nav, footer, aside and so on. This has now become known (by a term originally coined by Bruce Lawson) as the “Scooby Doo Algorithm.”

Misuse

In the past I was inclined to agree with this but after seeing how people have been using the new HTML5 elements, both when curating the HTML5 Gallery and viewing other site’s source code, the truth is that people are often not using these elements correctly and probably need any help they can get.

This in turn could mean that such a main element would also be misused, but since, unlike section and article, it’s meaning is quite clear and it is less likely to be a problem.

The existence of such an element itself would also aid accessibility, as the main content of a HTML document is easily identifiable by devices that needs to do so.

Personally I now feel that the addition of such an element would aid web authors who are laying out their content.

However.

Such an element will lead to different interpretation of what is main content?

Some may decide that all their elements are main content and therefore will lump them into any main element, whilst others may decide that all generic page headers, navigation, sidebars and footers are not main content and will therefore only enclose the page’s specific content within such a main element.

Which is correct? Perhaps neither of them are. So despite me saying earlier on that the meaning of such an element is “quite clear”, perhaps it isn’t, although Faulkner’s extension specification mentioned above does give some good examples of how it should be used, it is still open to misuse and it no doubt will be, if it is implemented.

Update –

The W3C has issued a call for consensus to publish the main element specification as a first public working draft.