When was the last time we received a new element? HTML5 introduced just nine new structural tags and they’ve been stable for several years: section, article, aside, hgroup, header, footer, nav, figure and figcaption. There are another 20 or so content elements including video, audio, canvas, progress etc.
Today, we have a new structural element to learn:
The main element represents the main content of the body of a document or application. The main content area consists of content that is directly related to or expands upon the central topic of a document or central functionality of an application.
Authors must not include more than one main element in a document.
Authors must not include the main element as a child of an article, aside, footer, header or nav element.
Content While This is may become unnecessary as browsers evolve ( The element’s also been added to the html5shiv so it will work in IE6, 7 and 8. You may need to download the new version if you’re using a locally-hosted file. The element has been surprisingly controversial. It’s been argued that it’s unnecessary and pages should permit more than one Source Link: http://www.sitepoint.com/html5-main-element/main marks the meaty content within your page, i.e. the target of a “skip to” link. You’ll probably use main where you had a content wrapper before; it will replace tags such as role="main" is defined…
My article
Browser Support
main is new, most browsers support unrecognized tags. However, you will need to apply a block style in your CSS, i.e.main
{
display: block
}
main is supported in Chrome and Firefox nightly builds), but there’s little harm retaining it.Can you use
main tag. But it’s here to stay and I think it will be useful. Just ensure you’ve thoroughly tested your new site prior to going live!