Home arrow HTML arrow Does HTML5 Need a Main Element?
HTML

Does HTML5 Need a Main Element?


The World Wide Web Consortium (W3) is already working on a draft specification for HTML 5.1. It should come as no surprise to anyone who follows this kind of thing that many of the proposed new standards have been coming up for debate. One of the points of contention is the new “main” element.

Author Info:
By: Terri Wells
Rating: 5 stars5 stars5 stars5 stars5 stars / 6
February 06, 2013

print this article
SEARCH DEVARTICLES

The World Wide Web Consortium (W3) is already working on a draft specification for HTML 5.1. It should come as no surprise to anyone who follows this kind of thing that many of the proposed new standards have been coming up for debate. One of the points of contention is the new “main” element.

As outlined on W3C's website, “The main element represents the main content section of the body of a document or application. The main content section consists of content that is directly related to or expands upon the central topic of a document or central functionality of an application.”

The main element is intended to single out content that is unique to a particular document, so it doesn't include items such as site navigation links, logos, banners, etc. You're also supposed to have only one main element per document, and it can't be a child of any header, footer, article, aside, or nav elements. Content within the main element can contain some of these items, however. The W3C's specification included one example of the main element's use with a graduation ceremony program listing; it featured a nav element with links to subsections of the content within the main element.

Steve Faulkner, technical director of The Paciello Group and one of the main element's strongest advocates, argues that in a sense, it's already being used. “Authors use a div with a descriptive id value like main, using it as a styling hook. Some also use this as a semantic identifier using an ARIA [accessible rich Internet application] role=main, which provides identification and navigation benefits for assistive technology users,” he explained.

Not everyone is convinced of the need for a main element in HTML 5.1's draft specification. HTML 5 spec editor Ian Hickson, for example, believes that the main element probably won't work as intended – as a way for users to quickly click to the meat of the content on a page. He pointed out that authors mark up the main content on their pages in a wide variety of ways, and even differ as to what they consider to be main content. He insisted that it would be the “luck of the draw” each time users tried to move to main landmark, with no way to know if the command would actually do what they expect.

Additionally, Hickson thinks that the main content of a page would already be correctly implied if developers took full advantage of HTML to mark up their documents. Your main content, then, is “everything you didn't mark up as an aside, a header, a navigation block, etc., and so browsers could already skip to the next bit of important content, without any changes to the mark-up language at all,” he insists.

Faulkner responded to this, saying that this may be true in an idealized world, “but looking at real-world mark-up patterns, the informal identification of the main content using a div and id is a much more accurate indicator of the primary content area within a page” than the approach Hickson proposes.

Hickson's points may have merit, but I have to admit, as a writer, I tend to side with Faulkner. We don't look at a page and think, “Everything that isn't outside of these margins is our main content.” We think inclusively, not exclusively. The positive designation that a main element represents works well with a writer's approach. I know that developers tend to think differently, but I rather doubt that their thought processes are so different that the idea of using a main element would seem alien and unnatural.

Additionally, while it might be the luck of the draw at first for assistive browsing devices to react appropriately, it seems to me that this has always been true for various proposed standards. That, alone, doesn't seem to be enough of a reason to argue against it. If adopting the main element made the current situation worse, that would be different.

In short, I think the main element, and the idea behind it, may be a worthy addition to the HTML 5.1 draft standard. What do you think? Would you use a main element?    


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

All HTML Tutorials
More By Terri Wells


blog comments powered by Disqus
HTML ARTICLES

- Does HTML5 Need a Main Element?
- Revisiting the HTML5 vs. Native Debate
- HTML5: Not for Phone Apps?
- HTML5 or Native?
- Job Hunting? Freelancer.com Lists This Quart...
- HTML5 in the News
- Report: HTML5 Mobile Performance Lags
- The Top HTML5 Audio Players
- Top HTML5 Video Tutorials
- HTML5: Reasons to Learn and Use It
- More of the Top Tutorials for HTML5 Forms
- MobileAppWizard Releases HTML5 App Builder
- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials