<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    >

<channel>
    <title>Webmonkey &#187; Main</title>
    <atom:link href="http://www.webmonkey.com/tag/main/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.webmonkey.com</link>
    <description>The Web Developer&#039;s Resource</description>
    <lastBuildDate>Mon, 06 May 2013 17:29:19 +0000</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=3.4.2</generator>
    
    <item>
        <title>&#8216;Main&#8217; Element Lands a Starring Role in HTML</title>
        <link>http://www.webmonkey.com/2013/02/main-element-lands-a-starring-role-in-html/</link>
        <comments>http://www.webmonkey.com/2013/02/main-element-lands-a-starring-role-in-html/#comments</comments>
        <pubDate>Mon, 04 Feb 2013 16:03:41 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=60791</guid>
        		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[Main]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2013/02/mainstar1-200x100.png" type="image/png" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2013/02/mainstar1.png" alt="&#8216;Main&#8217; Element Lands a Starring Role in HTML" /></div>HTML5 introduces a lot of new tags, but none of them help you indicate the main point of a webpage. The aptly named "main" element will change that. The proposed main element is now part of the HTML draft specification and you can use it today.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><div id="attachment_60797" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2013/02/mainstar1.png"><img src="http://www.webmonkey.com/wp-content/uploads/2013/02/mainstar1.png" alt="" title="mainstar" width="580" height="352" class="size-full wp-image-60797" /></a><p class="wp-caption-text"><em>Original Image by <a href="https://secure.flickr.com/photos/christianhaugen/3556081167/in/photostream/">Christian Haugen/Flickr</a></em></p></div>HTML5 introduces several new tags that give HTML more semantic meaning. There&#8217;s <code>&lt;nav&gt;</code> for navigation elements, <code>&lt;header&gt;</code> for headers, <code>&lt;footer&gt;</code> for footers and now a new element has been <a href="http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-main-element">added to the HTML draft spec</a> &#8212; <code>&lt;main&gt;</code>, to wrap around, well, the main content on a page.</p>
<p>As we reported back when the W3C&#8217;s HTML Working Group <a href="http://www.webmonkey.com/2012/12/proposed-main-element-would-help-html-get-to-the-point/">first considered adding it to the list of HTML elements</a>, the primary purpose of the main element is to map the <a href="http://www.w3.org/TR/wai-aria/roles#landmark_roles">WAI-ARIA landmark role</a> &#8220;main&#8221; to an HTML element. </p>
<p>Thanks to the hard work of developer <a href="http://www.paciellogroup.com/blog/author/admin/">Steve Faulkner</a>, who wrote up the <a href="http://www.w3.org/html/wg/wiki/User:Sfaulkne/main-usecases">proposal for <code>&lt;main&gt;</code></a> and did much of the hard work convincing the Working Group that it was worth adding to the spec, you can start using the main element today. In fact <code>&lt;main&gt;</code> is already natively supported in nightly builds of Firefox and Chrome.</p>
<p>There&#8217;s an ongoing debate as to whether more than one <code>&lt;main&gt;</code> element should be allowed on the page. Currently the W3C&#8217;s draft of the spec explicitly prohibits more than one <code>&lt;main&gt;</code> per page, but the WHATWG&#8217;s version of the spec is less specific. </p>
<p>It might sound counter-intuitive to have more than one <code>&lt;main&gt;</code> per page, but the argument is that the rest of the new block level tags have no such restrictions. In other words, there can be more than one <code>&lt;header&gt;</code>, more than one <code>&lt;footer&gt;</code> and more than one <code>&lt;nav&gt;</code> so why not more than one <code>&lt;main&gt;</code>? Developer Jeremy Keith has a post on <a href="http://adactio.com/journal/6014/">why more than one <code>&lt;main&gt;</code> could be a good idea</a>. [Update: There's also been some <a href="http://lists.w3.org/Archives/Public/public-html/2013Feb/thread.html#msg3">discussion on the HTML WG mailing list</a> and a call for <a href="http://lists.w3.org/Archives/Public/public-html/2013Feb/0007.html">supporting data</a>. As Steven Falkner notes in the comments below "the discussion continues, but at this stage there is no evidence that such a change will bring a benefit to users and may well complicate the usage of the feature and dilute its meaning and benefit for users."]</p>
<p>For now we suggest sticking to just one main element per page, which simplifies using <code>&lt;main&gt;</code>. Chances are you have something like <code>&lt;div id="main"&gt;</code> in your code right now. To use the new main element, just rewrite that to be <code>&lt;main role="main"&gt;</code>.</p>
<p>The <code>role="main"</code> may seem redundant, and someday it will be, but right now it acts as a polyfill for older web browsers, ensuring that they map the element to accessibility APIs. Older browsers will also need to be told about the element&#8217;s block level status with <code>main {display:block;}</code>. <a href="https://github.com/aFarkas/html5shiv/">HTML5 shiv</a>, a popular way to add support for the new elements to older browsers, has already been updated to support <code>&lt;main&gt;</code>.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2013/02/main-element-lands-a-starring-role-in-html/feed/</wfw:commentRss>
        <slash:comments>0</slash:comments>

        
    </item>
    </channel>
</rss>
