<?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>HTML5 Doctor &#187; Structure</title>
	<atom:link href="http://html5doctor.com/category/structure/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Tue, 27 Jul 2010 14:36:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Your Questions Answered #5</title>
		<link>http://html5doctor.com/your-questions-5/</link>
		<comments>http://html5doctor.com/your-questions-5/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 14:30:55 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[nav]]></category>
		<category><![CDATA[outline]]></category>
		<category><![CDATA[section]]></category>
		<category><![CDATA[sectioning]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1400</guid>
		<description><![CDATA[We're back with our first round up of your questions for 2010. In this article we'll be covering a range of topics including sections and sectioning, the <code>img</code> element, scaling video and a proposal for a <code>field</code> element. ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://html5doctor.com/wp-content/uploads/2009/07/html5doctor-treatment.gif" alt="Doctor treating a patient illustration" class="alignright size-full wp-image-424" /> We&#8217;re back with our first roundup of your questions for 2010. In this article, we&#8217;ll be covering a range of topics including sections and sectioning, the <code>&lt;img&gt;</code> element, scaling video, and a proposal for a <code>&lt;field&gt;</code> element. </p>
<h2>Headers and sidebars</h2>
<p>Ad asked:</p>
<blockquote><p>Hello,</p>
<p>I have 2 questions:</p>
<p>1. If I have my main navigation above the masterhead would best practise be having the nav tag inside of a header tag with the h1 and h2 in a hgroup? Or should the nav and header tag be separate?</p>
<p>2. I am building a blog in HTML5. It has a blog-like sidebar with articles, contact info and about info in it. Would the best tag to wrap this in be section or aside?</p>
<p>Thank you so much for your time,<br />
Ad Taylor</p></blockquote>
<p>Placing your <code>&lt;nav&gt;</code> within your <code>&lt;header&gt;</code> is fine and valid. However, if it makes more sense to leave it outside, then you can do that too. You don&#8217;t need to put the <code>&lt;hgroup&gt;</code> inside the <code>&lt;nav&gt;</code> though.</p>
<p>See our articles on <a href="http://html5doctor.com/the-header-element/"><code>&lt;header&gt;</code></a> and <a href="http://html5doctor.com/nav-element/"><code>&lt;nav&gt;</code></a> for more on this.</p>
<p>Regarding your second question, I would use <code>&lt;aside&gt;</code> (as we&#8217;ve done on the HTML5 doctor site) and then use multiple sections within that. Also see Bruce&#8217;s article on <a href="http://html5doctor.com/designing-a-blog-with-html5/">Designing a blog with HTML5</a>.</p>
<p>Hope that helps.</p>
<p>Cheers, Rich</p>
<h2>HTML5 <code>&lt;img&gt;</code> element</h2>
<p>Martijn asked:</p>
<blockquote><p>As you are, according to the slogan, &#8220;helping [me] implement HTML5 today,&#8221; I thought to bother you people with a spec. related question.</p>
<p>What should an UA do with an image without specified width and height attributes?</p>
<p>The dimension attributes part of the specification keeps stating &#8220;if specified&#8221; for every rule but doesn&#8217;t give any &#8220;if not specified&#8221;.</p>
<p>The part of the specification defining the img element itself does not state anything of importance about the dimension attributes apart from how the attributes in the DOM should be created by the UA.</p>
<p>Interesting is to note that they have omitted these attributes in all their img element examples.</p>
<p>In the dimension attribute section they go state the following.</p>
<p> &#8211; The dimension attributes are not intended to be used to stretch the image.</p>
<p>So we can only use them to make images smaller? This is odd as well so let&#8217;s say by stretch they mean to say both expending and shrinking in size. In this case the attributes can only be used for two cases:</p>
<p>1. To state the exact width and height of the image. Something that seems redundant unless not using those attributes means the UA can display the image at any size (which it might, as nothing about this is defined in the spec.).</p>
<p>2. To give a 0 in both attributes. By this I am telling the UA that the image is not to be seen by the user.</p>
<p>Am I missing something or is the specification missing this?</p>
<p>Looking forward to getting your prescription <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Kind Regards, Martijn</p></blockquote>
<p>If no dimension attributes are specified, the browser will leave no space for the image, and once the image has been loaded (after the rest of the page), it will then need to reflow the entire page, as that&#8217;s the first time it knows the size of the image. This can cause the content you&#8217;re reading scrolling off the page.</p>
<p>If you give the size of the image as attributes in the HTML, the browser will leave space and render the image there once it&#8217;s loaded without reflowing the page. On a mobile phone, reflowing the page unnecessarily drains the battery, and users can get vertigo from the page&#8217;s text jumping around to accommodate images.</p>
<p>Thanks, Bruce</p>
<h2>Section and Sectioning</h2>
<p>Yanoo asked:</p>
<blockquote><p>Hi,</p>
<p>What do you mean when you are talking about &#8220;sectioning&#8221;? And why don&#8217;t header and footer require sectioning?</p>
<p>I think about section and sectioning like about part of something defined. News, comment, page content, sidebar, *header*, and *footer*. Is it bad representation?</p></blockquote>
<p>Sectioning relates to the headings in some block of related content and defining what is related to what in a hierarchy of headings (<code>&lt;h1&gt;</code>&ndash;<code>&lt;h6&gt;</code>). The outlining algorithm can produce a table of contents from the nested <code>&lt;section&gt;</code>, <code>&lt;article&gt;</code>, <code>&lt;nav&gt;</code>, and <code>&lt;aside&gt;</code> elements.</p>
<p>Headers and footers themselves do not change the outline; a header or footer may contain no headings. If a header or footer <em>does</em> contain a heading, then that heading does come into the outline. See our article on <a href="http://html5doctor.com/the-section-element/">the section element</a>.</p>
<p>Thanks, Bruce</p>
<h2>Scaling the Video</h2>
<p>Ian asked:</p>
<blockquote><p>Hi there,</p>
<p>Not sure if this question is an appropriate one, but any help would be really appreciated.</p>
<p>I&#8217;m going about updating my video website, chutney.ie, and would love to implement HTML5. I am interested in replicating the scaling effect/style used on the <a href="http://www.mozilla.com/en-US/firefox/3.5/firstrun/">Mozilla welcome page</a>.</p>
<p>Not being overly knowledgeable in this area, I would love to know how to begin &mdash; is this effect a Flash based animation, or something that can be achieved with HTML alone?</p>
<p>Again, any nudge in the right direction would be great.</p>
<p>Many thanks,</p>
<p>Ian</p></blockquote>
<p>I&#8217;m not sure how Mozilla did it, but you can use some of the Webkit and Mozilla transforms on the <code>&lt;video&gt;</code> element. For example, you can cause the video to grow on hover &mdash; <a href="http://people.opera.com/patrickl/articles/introduction-html5-video/transitions/">see this example in Chrome, Safari, or Opera</a>. You can also use the <code>:target</code> pseudoclass to initiate animations. Alternatively, you can use a JavaScript <code>onClick</code> event to create the same effect. </p>
<p>You can also combine <code>&lt;video&gt;</code> and <code>&lt;canvas&gt;</code> to provide some interesting results (laying the <code>&lt;canvas&gt;</code> over the <code>&lt;video&gt;</code>). For more on the <code>&lt;video&gt;</code> element and what it can do, please read the <a href="http://dev.opera.com/articles/view/introduction-html5-video/">Introduction to <abbr>HTML</abbr>5 Video</a> on dev Opera written by <a href="http://twitter.com/brucel">Bruce Lawson</a> and <a href="http://twitter.com/patrick_h_lauke">Patrick Lauke</a>.</p>
<p>Cheers, Rich</p>
<h2>We need a <code>&lt;field&gt;</code> tag</h2>
<p>John wrote in and proposed a field element:</p>
<blockquote><p>Hey there. First off thanks for the site. I was excited to find it. I spent a little time on the W3C site and honestly couldn&#8217;t figure out how to submit suggestions there. So going to submit mine to you guys and maybe you can pass it on (if it is good) or point me to someone that can help. Ok to the point:</p>
<p>We are getting nice new tags to with HTML5 (nav, footer, etc) to help us create more semantic code. I think what we really need is a <code>field</code> tag &mdash; after all what are fieldsets sets of?</p>
<p>Everyone wraps up their labels and inputs with some element. Some of us do this with UL, some people do it with DT/DD, some with DIVs and some people out there insist that a form is tabular data.</p>
<p>We are all just bastardizing these elements because there is no clear semantic wrapper for field elements of a form.</p>
<p>I think you get the point. I&#8217;m trying to keep this email short. If you think there is anything to this argument, I have a more detailed summary (with example code) at:</p>
<p><a href="http://john.mirick.me/2009/10/what-is-really-set-of-shouldnt-we-have.html">http://john.mirick.me/2009/10/what-is-really-set-of-shouldnt-we-have.html</a></p>
<p>I would love to hear your thoughts on this.</p>
<p>Thanks!<br />
John</p></blockquote>
<p>While a field element would be nice &mdash; it would stop the argument over how best to mark-up forms &mdash; you have to ask yourself whether or not it actually adds any semantic or functional value to an HTML document. Yes, wrapping inputs and their labels in a field would make things easier to read and drop the need for the <code>for</code> attribute on the label (since the relationship can be assumed), but doing so would not be backwards compatible. In theory, we could continue to add <code>for</code> until there is a suitable time to drop it, but again I question the value of such a tag.</p>
<p>The purpose of wrapping form input/label pairs is generally to ease styling. My personal stance is that unless there are case studies showing how such an element can add more value to HTML forms, this proposal won&#8217;t make it very far.</p>
<p>Regards, Mike</p>
<h2>Got a question for us?</h2>
<p>That wraps up this round of questions. If you&#8217;ve got a query about the HTML5 spec or how to implement it, you can <a href="http://html5doctor.com/ask-the-doctor/">get in touch</a> with us and we&#8217;ll do our best to help. </p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-7/" rel="bookmark" class="crp_title">Your Questions Answered #7</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-6/" rel="bookmark" class="crp_title">Your Questions Answered #6</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-10/" rel="bookmark" class="crp_title">Your Questions Answered #10</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%235%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235&amp;bodytext=We%27re%20back%20with%20our%20first%20round%20up%20of%20your%20questions%20for%202010.%20In%20this%20article%20we%27ll%20be%20covering%20a%20range%20of%20topics%20including%20sections%20and%20sectioning%2C%20the%20img%20element%2C%20scaling%20video%20and%20a%20proposal%20for%20a%20field%20element.%20" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235&amp;notes=We%27re%20back%20with%20our%20first%20round%20up%20of%20your%20questions%20for%202010.%20In%20this%20article%20we%27ll%20be%20covering%20a%20range%20of%20topics%20including%20sections%20and%20sectioning%2C%20the%20img%20element%2C%20scaling%20video%20and%20a%20proposal%20for%20a%20field%20element.%20" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Your%20Questions%20Answered%20%235&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;t=Your%20Questions%20Answered%20%235" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235&amp;annotation=We%27re%20back%20with%20our%20first%20round%20up%20of%20your%20questions%20for%202010.%20In%20this%20article%20we%27ll%20be%20covering%20a%20range%20of%20topics%20including%20sections%20and%20sectioning%2C%20the%20img%20element%2C%20scaling%20video%20and%20a%20proposal%20for%20a%20field%20element.%20" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Your%20Questions%20Answered%20%235&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;t=Your%20Questions%20Answered%20%235" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;title=Your%20Questions%20Answered%20%235&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%27re%20back%20with%20our%20first%20round%20up%20of%20your%20questions%20for%202010.%20In%20this%20article%20we%27ll%20be%20covering%20a%20range%20of%20topics%20including%20sections%20and%20sectioning%2C%20the%20img%20element%2C%20scaling%20video%20and%20a%20proposal%20for%20a%20field%20element.%20" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;h=Your%20Questions%20Answered%20%235" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-5%2F&amp;t=Your%20Questions%20Answered%20%235&amp;s=We%27re%20back%20with%20our%20first%20round%20up%20of%20your%20questions%20for%202010.%20In%20this%20article%20we%27ll%20be%20covering%20a%20range%20of%20topics%20including%20sections%20and%20sectioning%2C%20the%20img%20element%2C%20scaling%20video%20and%20a%20proposal%20for%20a%20field%20element.%20" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/your-questions-5/" rel="bookmark">Your Questions Answered #5</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on March 2, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-5/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Legend not such a legend anymore</title>
		<link>http://html5doctor.com/legend-not-such-a-legend-anymore/</link>
		<comments>http://html5doctor.com/legend-not-such-a-legend-anymore/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 12:00:26 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[details]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[legend]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=646</guid>
		<description><![CDATA[Lately I decided I was going to recreate the interactive features of the details element using JavaScript (apparently the same day as fellow Brightonian Jeremy Keith). However I ran in to some very serious issues with the tag, so serious, in it’s current state, it’s unusable.]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
            <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F">
                <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
            </a>
        </div>Lately I decided I was going to recreate the interactive features of the <code>details</code> element using JavaScript (apparently <a href="http://twitter.com/adactio/status/2869549874">the same day</a> as fellow Brightonian <a href="http://adactio.com/" title="Adactio: Jeremy Keith">Jeremy Keith</a>).</p>

<p>However I ran in to some very serious issues with the tag, so serious, in it&#8217;s current state, it&#8217;s unusable.</p>

<p><span id="more-646"></span></p>

<h2>Overview of the details element</h2>

<p>The <code>details</code> element, by default, is a collapsed element whose summary, or label, is the first child <code>legend</code> (if no <code>legend</code> is used, the UA provides a default, such as &#8220;Details&#8221;), with a triangular button to indicate it&#8217;s current open state.</p>

<p>If you include the <code>open</code> attribute, then the element is open by default.  In theory, you could attach a click event to the legend, and switch the <code>open</code> attribute.</p>

<p>The markup would roughly be this:</p>

<pre><code>&lt;details open=&quot;open&quot;&gt;
  &lt;legend&gt;Terms &amp; Conditions&lt;/legend&gt;
  &lt;p&gt;You agree to xyz, etc.&lt;/p&gt;
&lt;/details&gt;</code></pre>

<p>Here&#8217;s the details test page I was working from: <a href="http://remysharp.com/demo/details.html">HTML 5 details test</a></p>

<h2>The issues</h2>

<p>The biggest problem, and the show stopper for me, is that the browser&#8217;s treatment of the <code>legend</code> element completely breaks this markup pattern &#8211; this is true for <strong>all</strong> the major browsers: Opera, Safari, Firefox and IE (tested in all the latest and some older browsers).  I&#8217;ll go in these issues in detail in a moment.</p>

<p>Other problems include:</p>

<ul>
<li>Styling the legend element is exceptionally difficult, particularly positioning</li>
<li>Using the <a href="http://www.whatwg.org/" title="Web Hypertext Application Technology Working Group">WHATWG</a> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#the-details-element-0">guidelines to styling</a> the <code>details</code> element prove both difficult to interpret and difficult to implement.</li>
<li>When using CSS to style the open state of the <code>details</code> element using: <code>details[open] { height: auto; }</code>, meant that once I changed the open state using JavaScript, it wouldn&#8217;t trigger the browser to redraw (as it would if I had added a class). I&#8217;ve <a href="http://twitter.com/rem/status/2178972149">run in to this before</a>, CSS 2.1 is styling source, not the DOM.</li>
</ul>

<h2>Legend treatment</h2>

<p>Surprisingly Firefox is the worst one out in these issues, the rest of the browsers have fairly same treatment of the issue.  In the screenshots, I&#8217;ve included a <code>fieldset</code> and nested <code>legend</code> for reference.</p>

<h3>Internet Explorer</h3>

<p>IE7 &#038; IE8 closes the <code>legend</code> element it encounters when it&#8217;s not inside a <code>fieldset</code> element and move it&#8217;s contents out to an adjacent text node.</p>

<p>What&#8217;s also strange, is that looking at the DOM it also creates another empty(?) closed <code>legend</code> element after that text node.  It doesn&#8217;t have any effect, but just looked odd:</p>

<p><img src="http://remysharp.com/wp-content/uploads/2009/07/ies-details-element-treatment.jpg" alt="IE's details element treatment" /></p>

<h3>Opera</h3>

<p>Opera (9 &#038; 10b) is very similar to IE in it&#8217;s treatment of the <code>legend</code> in the details element, except it doesn&#8217;t create the second closing <code>legend</code> node.  It just closes the <code>legend</code>, and creates the adjacent text node.</p>

<h3>Safari</h3>

<p>Safari simply strips the <code>legend</code> all together out of the DOM.  So much so, that if you open the web inspector, then the error console, you&#8217;ll see it warning out that it&#8217;s encountered an illegal element, ignoring it, then encountering the closing tag, so it ignores that too.  You&#8217;re left with just the text node.</p>

<h3>Firefox</h3>

<p>The best for last.  Firefox goes one step beyond the other browsers.  It assumes you&#8217;ve forgotten to include the <code>fieldset</code> element.  So when it hits the <code>legend</code> element, Firefox inserts an opening <code>fieldset</code> up until it finds (I believe) the closing <code>fieldset</code> element, which obviously it <em>doesn&#8217;t</em> so the result is the rest of the DOM, after the first illegally placed <code>legend</code> ends up eaten by <code>fieldset</code> element, which leaves my DOM in a mess:</p>

<p><img src="http://remysharp.com/wp-content/uploads/2009/07/firefox-details-treatment.jpg" alt="Firefox details treatment" /></p>

<h2>Impact on other elements</h2>

<p><code>details</code> isn&#8217;t the only element that reuses the <code>legend</code> element for labelling, the <code>figure</code> element also is <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-0.html#the-figure-element">supposed to support</a> the <code>legend</code> element.  The result is obviously going to be the same.</p>

<h2>Conclusion</h2>

<p>We can&#8217;t style the legend element when the text is being thrown out by all the browsers, and Firefox&#8217;s DOM mangling is just too painful to look at.</p>

<p>This basically means that we can&#8217;t, in any reasonable amount of time, use the <code>legend</code> element inside both the <code>details</code> and <code>figure</code> element in the spec&#8217;s current state.</p>

<p>For me, I&#8217;ll be using an alternative element, probably just a <code>p</code> element styled to look like a <code>legend</code>, but that&#8217;s really not the point.  Ideas anyone?</p>

<p>It turns out we weren&#8217;t the only ones looking at this and <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/021494.html">Ian Hickson</a> has responded on the issue:</p>

<blockquote cite="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/021494.html"><p>My plan here is to continue to wait for a while longer to see if the parsing issues can get ironed out (the HTML5 parser in Gecko for instance solves this problem for Firefox). If we really can&#8217;t get past this, we&#8217;ll have to introduce a new element, but I&#8217;m trying to avoid going there.</p></blockquote>

<p>It&#8217;s fine to think that Gecko will update, but it&#8217;s IE that I&#8217;m worried about, they <em>won&#8217;t</em> turn out their render engine, and the result is we&#8217;ll <em>have</em> to avoid using the <code>legend</code> in any element other than <code>fieldset</code>.<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/dd-details-wrong-again/" rel="bookmark" class="crp_title">dd-details wrong again</a></li><li><a href="http://html5doctor.com/summary-figcaption-element/" rel="bookmark" class="crp_title">Hello, summary and figcaption elements</a></li><li><a href="http://html5doctor.com/september-html5-spec-changes/" rel="bookmark" class="crp_title">September HTML5 spec changes</a></li><li><a href="http://html5doctor.com/speaking/" rel="bookmark" class="crp_title">HTML5 Doctor Speaking and Training Appearances</a></li><li><a href="http://html5doctor.com/the-figure-figcaption-elements/" rel="bookmark" class="crp_title">The figure &#038; figcaption elements</a></li></ul></div></p>

<p>Share and Save:</p>

<pre><code>&lt;a rel="nofollow"  href="http://twitter.com/home?status=Legend%20not%20such%20a%20legend%20anymore%20-%20http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F" title="Twitter"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;bodytext=Lately%20I%20decided%20I%20was%20going%20to%20recreate%20the%20interactive%20features%20of%20the%20details%20element%20using%20JavaScript%20%28apparently%20the%20same%20day%20as%20fellow%20Brightonian%20Jeremy%20Keith%29.%20However%20I%20ran%20in%20to%20some%20very%20serious%20issues%20with%20the%20tag%2C%20so%20serious%2C%20in%20it%E2%80%99s%20current%20state%2C%20it%E2%80%99s%20unusable." title="Digg"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F" title="Sphinn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore" title="Reddit"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;notes=Lately%20I%20decided%20I%20was%20going%20to%20recreate%20the%20interactive%20features%20of%20the%20details%20element%20using%20JavaScript%20%28apparently%20the%20same%20day%20as%20fellow%20Brightonian%20Jeremy%20Keith%29.%20However%20I%20ran%20in%20to%20some%20very%20serious%20issues%20with%20the%20tag%2C%20so%20serious%2C%20in%20it%E2%80%99s%20current%20state%2C%20it%E2%80%99s%20unusable." title="del.icio.us"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore" title="StumbleUpon"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F" title="Technorati"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.netvibes.com/share?title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F" title="Netvibes"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;t=Legend%20not%20such%20a%20legend%20anymore" title="Facebook"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;annotation=Lately%20I%20decided%20I%20was%20going%20to%20recreate%20the%20interactive%20features%20of%20the%20details%20element%20using%20JavaScript%20%28apparently%20the%20same%20day%20as%20fellow%20Brightonian%20Jeremy%20Keith%29.%20However%20I%20ran%20in%20to%20some%20very%20serious%20issues%20with%20the%20tag%2C%20so%20serious%2C%20in%20it%E2%80%99s%20current%20state%2C%20it%E2%80%99s%20unusable." title="Google Bookmarks"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.friendfeed.com/share?title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F" title="FriendFeed"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;t=Legend%20not%20such%20a%20legend%20anymore" title="HackerNews"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;title=Legend%20not%20such%20a%20legend%20anymore&amp;amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;amp;summary=Lately%20I%20decided%20I%20was%20going%20to%20recreate%20the%20interactive%20features%20of%20the%20details%20element%20using%20JavaScript%20%28apparently%20the%20same%20day%20as%20fellow%20Brightonian%20Jeremy%20Keith%29.%20However%20I%20ran%20in%20to%20some%20very%20serious%20issues%20with%20the%20tag%2C%20so%20serious%2C%20in%20it%E2%80%99s%20current%20state%2C%20it%E2%80%99s%20unusable." title="LinkedIn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;h=Legend%20not%20such%20a%20legend%20anymore" title="NewsVine"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;amp;u=http%3A%2F%2Fhtml5doctor.com%2Flegend-not-such-a-legend-anymore%2F&amp;amp;t=Legend%20not%20such%20a%20legend%20anymore&amp;amp;s=Lately%20I%20decided%20I%20was%20going%20to%20recreate%20the%20interactive%20features%20of%20the%20details%20element%20using%20JavaScript%20%28apparently%20the%20same%20day%20as%20fellow%20Brightonian%20Jeremy%20Keith%29.%20However%20I%20ran%20in%20to%20some%20very%20serious%20issues%20with%20the%20tag%2C%20so%20serious%2C%20in%20it%E2%80%99s%20current%20state%2C%20it%E2%80%99s%20unusable." title="Tumblr"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /&gt;&lt;/a&gt;
</code></pre>

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/legend-not-such-a-legend-anymore/" rel="bookmark">Legend not such a legend anymore</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 31, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/legend-not-such-a-legend-anymore/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>HTML5 Boilerplates</title>
		<link>http://html5doctor.com/html-5-boilerplates/</link>
		<comments>http://html5doctor.com/html-5-boilerplates/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 13:30:45 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Boilerplates]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[boilerplate]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=526</guid>
		<description><![CDATA[
			
				
			
		
Without going into the discussion of why HTML 5 is available today and not 2022, this article is going to give you a series of HTML 5 boilerplates that you can use in your projects right now.
HTML 5 in 5 seconds
It&#8217;s &#252;ber easy to get your markup to validate as HTML 5 &#8212; just change [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Without going into the discussion of why <abbr>HTML</abbr> 5 is available <em>today</em> and not 2022, this article is going to give you a series of <abbr>HTML</abbr> 5 boilerplates that you can use in your projects <em>right now</em>.</p>
<h2 id="html_5_in_5_seconds"><abbr>HTML</abbr> 5 in 5 seconds</h2>
<p>It&#8217;s &uuml;ber easy to get your markup to validate as <abbr>HTML</abbr> 5 &mdash; just change your <code>DOCTYPE</code> from whatever it is now to this:</p>
<pre><code>&lt;!DOCTYPE html&gt;</pre>
<p></code></p>
<p>That's it! It doesn't require anything more than that.</p>
<p>Google are doing it already. Check out their homepage, written all in one line:</p>
<pre><code>&lt;!doctype html&gt;&lt;head&gt;&lt;title&gt;HTML 5 - Google Search&lt;/title&gt;&lt;script&gt;...</code></pre>
<p>Ironically, Google's search and results pages don't validate because of their use of invalid tags like <code>&lt;font&gt;</code> and a number of other errors, but that's okay. They can still take advantage of the <abbr>HTML</abbr> 5 parsing rules (e.g., no <code>type</code> attribute on the <code>&lt;script&gt;</code> element) by using the correct <code>DOCTYPE</code>.</p>
<h2 id="html_5_minified"><abbr>HTML</abbr> 5 minified</h2>
<p>If you like to knock out quick prototypes or experiments that don't require much styling, you might be interested in a miniature document in <abbr>HTML</abbr> 5:</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;title&gt;Small HTML 5&lt;/title&gt;
&lt;p&gt;Hello world&lt;/p&gt;</code></pre>
<p>That's <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fjsbin.com%2Fowata&amp;ss=1">completely valid <abbr>HTML</abbr> 5</a> too.</p>
<p>(Interestingly, there was some disagreement about this pattern's validity when I removed the <code>&lt;title&gt;</code> tag. <a href="http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cp%3EHello%20World%3C%2Fp%3E">Hixie's DOM viewer</a> says it's fine, and so does the W3C validator as long as the markup is entered manually. But Henri Sivonen's validator says it's invalid without the <code>&lt;title&gt;</code> tag. The W3C validator also says it's invalid when you <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fjsbin.com%2Feyuqe&amp;ss=1">give it a url</a>. Hopefully, this will get sorted out soon.)</p>
<h2 id="html_5_complete_compatible"><abbr>HTML</abbr> 5 complete &amp; compatible</h2>
<p>This final, more complete boilerplate also indicates the character set. Without it, some characters will not render properly (and I've spent too much time in the past trying to work out why!).</p>
<p>We're also including the <a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/"><abbr>HTML</abbr> 5 shiv</a> so that we can style elements in IE. Note that <a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/#a-little-head">you <em>must</em> include this script in the <code>&lt;head&gt;</code> element</a>.</p>
<p>Finally, we're adding a few <abbr>CSS</abbr> rules to cause the new block-level elements to render as such, since some browsers don't know about them natively.</p>
<p>So here it is &mdash; a valid and complete HTML 5 document boilerplate:</p>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;title&gt;HTML 5 complete&lt;/title&gt;
&lt;!--[if IE]&gt;
&lt;script src=&quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
&lt;style&gt;
  article, aside, details, figcaption, figure, footer, header,
  hgroup, menu, nav, section { display: block; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Hello World&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p>If you want to experiment with <abbr>HTML</abbr> 5, the <a href="http://jsbin.com/">default JS Bin template</a> is an HTML5 boilerplate for you to play with too.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/" rel="bookmark" class="crp_title">How to get HTML5 working in IE and Firefox 2</a></li>
<li><a href="http://html5doctor.com/absent-elements-and-validation/" rel="bookmark" class="crp_title">Absent Elements and Validation</a></li>
<li><a href="http://html5doctor.com/native-drag-and-drop/" rel="bookmark" class="crp_title">Native Drag and Drop</a></li>
<li><a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/" rel="bookmark" class="crp_title">How to use HTML5 in your client work right now</a></li>
<li><a href="http://html5doctor.com/block-level-links-in-html-5/" rel="bookmark" class="crp_title">&#8220;Block-level&#8221; links in HTML5</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=HTML5%20Boilerplates%20-%20http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates&amp;bodytext=Without%20going%20into%20the%20discussion%20of%20why%20HTML%205%20is%20available%20today%20and%20not%202022%2C%20this%20article%20is%20going%20to%20give%20you%20a%20series%20of%20HTML%205%20boilerplates%20that%20you%20can%20use%20in%20your%20projects%20right%20now.%0D%0A%0D%0AHTML%205%20in%205%20seconds%0D%0A%0D%0AIt%27s%20%26uuml%3Bber%20easy%20to%20get%20your%20" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates&amp;notes=Without%20going%20into%20the%20discussion%20of%20why%20HTML%205%20is%20available%20today%20and%20not%202022%2C%20this%20article%20is%20going%20to%20give%20you%20a%20series%20of%20HTML%205%20boilerplates%20that%20you%20can%20use%20in%20your%20projects%20right%20now.%0D%0A%0D%0AHTML%205%20in%205%20seconds%0D%0A%0D%0AIt%27s%20%26uuml%3Bber%20easy%20to%20get%20your%20" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=HTML5%20Boilerplates&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;t=HTML5%20Boilerplates" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates&amp;annotation=Without%20going%20into%20the%20discussion%20of%20why%20HTML%205%20is%20available%20today%20and%20not%202022%2C%20this%20article%20is%20going%20to%20give%20you%20a%20series%20of%20HTML%205%20boilerplates%20that%20you%20can%20use%20in%20your%20projects%20right%20now.%0D%0A%0D%0AHTML%205%20in%205%20seconds%0D%0A%0D%0AIt%27s%20%26uuml%3Bber%20easy%20to%20get%20your%20" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=HTML5%20Boilerplates&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;t=HTML5%20Boilerplates" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;title=HTML5%20Boilerplates&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Without%20going%20into%20the%20discussion%20of%20why%20HTML%205%20is%20available%20today%20and%20not%202022%2C%20this%20article%20is%20going%20to%20give%20you%20a%20series%20of%20HTML%205%20boilerplates%20that%20you%20can%20use%20in%20your%20projects%20right%20now.%0D%0A%0D%0AHTML%205%20in%205%20seconds%0D%0A%0D%0AIt%27s%20%26uuml%3Bber%20easy%20to%20get%20your%20" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;h=HTML5%20Boilerplates" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-boilerplates%2F&amp;t=HTML5%20Boilerplates&amp;s=Without%20going%20into%20the%20discussion%20of%20why%20HTML%205%20is%20available%20today%20and%20not%202022%2C%20this%20article%20is%20going%20to%20give%20you%20a%20series%20of%20HTML%205%20boilerplates%20that%20you%20can%20use%20in%20your%20projects%20right%20now.%0D%0A%0D%0AHTML%205%20in%205%20seconds%0D%0A%0D%0AIt%27s%20%26uuml%3Bber%20easy%20to%20get%20your%20" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/html-5-boilerplates/" rel="bookmark">HTML5 Boilerplates</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 17, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html-5-boilerplates/feed/</wfw:commentRss>
		<slash:comments>82</slash:comments>
		</item>
		<item>
		<title>Semantic navigation with the nav element</title>
		<link>http://html5doctor.com/nav-element/</link>
		<comments>http://html5doctor.com/nav-element/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 14:31:45 +0000</pubDate>
		<dc:creator>Tom Leadbetter</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[nav]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=473</guid>
		<description><![CDATA[One of the new elements for HTML 5 is the <code>&#60;nav&#62;</code> element which allows you to group together links, resulting in more semantic meaning for your markup, and help help structure the content for screenreaders. In this article I'll discuss how and where to use it as well as some reservations I have with the specifications definition.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the new elements for HTML 5 is the <code>&lt;nav&gt;</code> element which allows you to group together links, resulting in more semantic  markup  and extra structure which  may help screenreaders. In this article I&#8217;ll discuss how and where to use it as well as some reservations I have with the specifications definition.</p>
<p>At first, I thought the <code>&lt;nav&gt;</code> element to be pretty simple. And whilst it still is very easy to use, I found the <a href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element">specification </a> to not be overly helpful; a lot of decisions are left to the developer. Then on Monday Hixie made a <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-July/021008.html">change to the definition</a> of <code>&lt;nav&gt;</code> in the draft following a prompt from our very own <a href="http://html5doctor.com/author/brucel/">Dr Bruce</a>. </p>
<h2>How to use it</h2>
<p>You are probably used to using something like</p>
<pre><code>&lt;div id="nav"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a.... etc</code></pre>
<p>Or</p>
<pre><code>&lt;ul id="mainNav"&gt;</code></pre>
<p>Well, for the sake of your markup, nothing much will change as you will now have something like this</p>
<pre><code>&lt;nav&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/about/"&gt;About&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/blog/"&gt;Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;</code></pre>
<h2>The specification</h2>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-nav-element"><abbr>HTML</abbr> 5 specification</a> defines <code>&lt;nav&gt;</code> as:</p>
<blockquote><p>The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links. Not all groups of links on a page need to be in a nav element only sections that consist of major navigation blocks are appropriate for the nav element. In particular, it is common for footers to have a list of links to various key parts of a site, but the footer element is more appropriate in such cases, and no nav element is necessary for those links.</p></blockquote>
<p>The key phrase there is &#8220;<strong>major navigation</strong>&#8221; (previously primary navigation).</p>
<p>Looking at the example they give &#8211; <q>&#8220;In the following example, the page has several places where links are present, but only one of those places is considered a navigation section.&#8221;</q></p>
<pre><code>&lt;body&gt;
&lt;header&gt;
&lt;h1&gt;Wake up sheeple!&lt;/h1&gt;
&lt;p&gt;&lt;a href="news.html"&gt;News&lt;/a&gt; -
&lt;a href="blog.html"&gt;Blog&lt;/a&gt; -
&lt;a href="forums.html"&gt;Forums&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Last Modified: &lt;time&gt;2009-04-01&lt;/time&gt;&lt;/p&gt;

&lt;nav&gt;
&lt;h1&gt;Navigation&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="articles.html"&gt;Index of all articles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="today.html"&gt;Things sheeple need to wake up for today&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="successes.html"&gt;Sheeple we have managed to wake&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;

&lt;/header&gt;
&lt;article&gt;
&lt;p&gt;...<em>page content would be here</em>...&lt;/p&gt;
&lt;/article&gt;
&lt;footer&gt;
&lt;p&gt;Copyright &copy; 2006 The Example Company&lt;/p&gt;
&lt;p&gt;&lt;a href="about.html"&gt;About&lt;/a&gt; -
&lt;a href="policy.html"&gt;Privacy Policy&lt;/a&gt; -
&lt;a href="contact.html"&gt;Contact Us&lt;/a&gt;&lt;/p&gt;
&lt;/footer&gt;
&lt;/body&gt;</code></pre>
<p>I have to say that this is no use to me. There are six items of navigation in the header element there. But only three are in the nav tag. There is no explanation as to what differentiates the first three links with the second three links &#8211; both go to different pages and all are in internal to that current site.</p>
<p>They also give a second example:</p>
<pre><code>&lt;body&gt;
&lt;h1&gt;The Wiki Center Of Exampland&lt;/h1&gt;

&lt;nav&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/"&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/events"&gt;Current Events&lt;/a&gt;&lt;/li&gt;
...more...
&lt;/ul&gt;
&lt;/nav&gt;

&lt;article&gt;
&lt;header&gt;
&lt;h1&gt;Demos in Exampland&lt;/h1&gt;

&lt;nav&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#public"&gt;Public demonstrations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#destroy"&gt;Demolitions&lt;/a&gt;&lt;/li&gt;
...more...
&lt;/ul&gt;
&lt;/nav&gt;

&lt;/header&gt;
&lt;section id="public"&gt;
&lt;h1&gt;Public demonstrations&lt;/h1&gt;
&lt;p&gt;...more...&lt;/p&gt;
&lt;/section&gt;
&lt;section id="destroy"&gt;
&lt;h1&gt;Demolitions&lt;/h1&gt;
&lt;p&gt;...more...&lt;/p&gt;
&lt;/section&gt;
...more...
&lt;footer&gt;
&lt;p&gt;&lt;a href="?edit"&gt;Edit&lt;/a&gt; | &lt;a href="?delete"&gt;Delete&lt;/a&gt; | &lt;a href="?Rename"&gt;Rename&lt;/a&gt;&lt;/p&gt;
&lt;/footer&gt;
&lt;/article&gt;
&lt;footer&gt;
&lt;p&gt;&lt;small&gt;© copyright 1998 Exampland Emperor&lt;/small&gt;&lt;/p&gt;
&lt;/footer&gt;
&lt;/body&gt;</code></pre>
<p>This is a little more helpful as I find the biggest isse of the <code>&lt;nav&gt;</code> element is deciding which sets of links should be classed as major navigation.</p>
<h2>Where to use it?</h2>
<p>If you take a peek at the source code for this site, there are three uses (<em>Ed. or four if you&#8217;re on a page that includes pagination</em>) of the nav elements &#8211; we used it on the main navigation and above the footer (both are exactly the same links by the way). We also decided to use it on the skip links that are included for accessibility.</p>
<p>Looking at the content of the site, it could be argued that the <code>&lt;nav&gt;</code> element could be used on the Recent Articles and Categories listings in the sidebar. Should you do it? Honestly, I think it is hard to say from looking at the spec &#8211; but I would say these are not &#8220;major navigation&#8221; but it would tempting to do, particularly if you&#8217;re analytics suggest these areas of navigation are &#8216;major&#8217; ways in which your users navigate your site.</p>
<h3>Other Possible Uses</h3>
<p>Below are a few more examples of other areas of the site in which you might consider using the <code>&lt;nav&gt;</code> element. It is also important to note that while <abbr>XHTML</abbr> 2 <code>&lt;nl&gt;</code> element, this hasn&#8217;t been replicated in <abbr>HTML</abbr> 5 because navigation does not have to take list form, as we&#8217;ll see.</p>
<ul>
<li><strong>Table of Contents</strong><br />
I would say definitely yes to that &#8211; it is primary navigation for that particularly content</li>
<li><strong>Previous/next buttons (or pagination)<br />
</strong>I would say yes to this because it is important to the overall structure and hierarchy of the blog/site<strong><br />
</strong></li>
<li><strong>Search form<br />
</strong>For me, a definite yes, but it is not mentioned in the spec<strong>. </strong>A search form is hugely important to the navigation of a site, particularly large sites which rely almost solely on their search engine.<strong><br />
</strong></li>
<li><strong>Breadcrumbs<br />
</strong>Again, I would say yes to this as well. Although breadcrumbs are not always necessary and can be used when not applicable, on large sites a breadcrumb trail can be an important navigation aid.<strong> </strong></li>
</ul>
<h2>The difference of nav from menu</h2>
<p>If you aren&#8217;t aware there is another element that can confuse the issue in the <abbr>HTML</abbr> 5 specification &#8211; <a href="http://www.whatwg.org/specs/web-apps/current-work/#menus">menu</a>. I&#8217;ve noticed that some developers are using the <code>&lt;menu&gt;</code> element for navigation rather than the <code>&lt;nav&gt;</code> element. We thought it best to clarify that <code>&lt;menu&gt;</code> is to be used for a list of commands and is an interactive element and more likely to be used exclusively in Web Applications. We will be covering more about the <code>&lt;menu&gt;</code> element in a later post.</p>
<h2>And finally&hellip;</h2>
<p>Only with the help of the community, and hopefully a much clearer spec, can we be sure when and perhaps more importantly, when not to use the <code>&lt;nav&gt;</code> element.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/designing-a-blog-with-html5/" rel="bookmark" class="crp_title">Designing a blog with html5</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
<li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li>
<li><a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/" rel="bookmark" class="crp_title">How to use HTML5 in your client work right now</a></li>
<li><a href="http://html5doctor.com/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Semantic%20navigation%20with%20the%20nav%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element&amp;bodytext=One%20of%20the%20new%20elements%20for%20HTML%205%20is%20the%20%26lt%3Bnav%26gt%3B%20element%20which%20allows%20you%20to%20group%20together%20links%2C%20resulting%20in%20more%20semantic%20meaning%20for%20your%20markup%2C%20and%20help%20help%20structure%20the%20content%20for%20screenreaders.%20In%20this%20article%20I%27ll%20discuss%20how%20and%20where%20to%20use%20it%20as%20well%20as%20some%20reservations%20I%20have%20with%20the%20specifications%20definition." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element&amp;notes=One%20of%20the%20new%20elements%20for%20HTML%205%20is%20the%20%26lt%3Bnav%26gt%3B%20element%20which%20allows%20you%20to%20group%20together%20links%2C%20resulting%20in%20more%20semantic%20meaning%20for%20your%20markup%2C%20and%20help%20help%20structure%20the%20content%20for%20screenreaders.%20In%20this%20article%20I%27ll%20discuss%20how%20and%20where%20to%20use%20it%20as%20well%20as%20some%20reservations%20I%20have%20with%20the%20specifications%20definition." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Semantic%20navigation%20with%20the%20nav%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;t=Semantic%20navigation%20with%20the%20nav%20element" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element&amp;annotation=One%20of%20the%20new%20elements%20for%20HTML%205%20is%20the%20%26lt%3Bnav%26gt%3B%20element%20which%20allows%20you%20to%20group%20together%20links%2C%20resulting%20in%20more%20semantic%20meaning%20for%20your%20markup%2C%20and%20help%20help%20structure%20the%20content%20for%20screenreaders.%20In%20this%20article%20I%27ll%20discuss%20how%20and%20where%20to%20use%20it%20as%20well%20as%20some%20reservations%20I%20have%20with%20the%20specifications%20definition." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Semantic%20navigation%20with%20the%20nav%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;t=Semantic%20navigation%20with%20the%20nav%20element" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;title=Semantic%20navigation%20with%20the%20nav%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=One%20of%20the%20new%20elements%20for%20HTML%205%20is%20the%20%26lt%3Bnav%26gt%3B%20element%20which%20allows%20you%20to%20group%20together%20links%2C%20resulting%20in%20more%20semantic%20meaning%20for%20your%20markup%2C%20and%20help%20help%20structure%20the%20content%20for%20screenreaders.%20In%20this%20article%20I%27ll%20discuss%20how%20and%20where%20to%20use%20it%20as%20well%20as%20some%20reservations%20I%20have%20with%20the%20specifications%20definition." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;h=Semantic%20navigation%20with%20the%20nav%20element" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fnav-element%2F&amp;t=Semantic%20navigation%20with%20the%20nav%20element&amp;s=One%20of%20the%20new%20elements%20for%20HTML%205%20is%20the%20%26lt%3Bnav%26gt%3B%20element%20which%20allows%20you%20to%20group%20together%20links%2C%20resulting%20in%20more%20semantic%20meaning%20for%20your%20markup%2C%20and%20help%20help%20structure%20the%20content%20for%20screenreaders.%20In%20this%20article%20I%27ll%20discuss%20how%20and%20where%20to%20use%20it%20as%20well%20as%20some%20reservations%20I%20have%20with%20the%20specifications%20definition." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/nav-element/" rel="bookmark">Semantic navigation with the nav element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 15, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/nav-element/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>HTML 5 + XML = XHTML 5</title>
		<link>http://html5doctor.com/html-5-xml-xhtml-5/</link>
		<comments>http://html5doctor.com/html-5-xml-xhtml-5/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:20:41 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[XHTML 5]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=381</guid>
		<description><![CDATA[
			
				
			
		
(Also available in Spanish Traducción de “HTML 5 + XML = XHTML 5″ and  Portuguese.)
I like the xhtml syntax. It&#8217;s how I learned. I&#8217;m used to lowercase code, quoted attributes and trailing slashes on elements like br and img. They make me feel nice and comfy, like a cup of Ovaltine and The Evil [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>(Also available in Spanish <a lang="es" href="http://www.htmlcinco.com/traduccion-de-html-5-xml-xhtml-5/">Traducción de “HTML 5 + XML = XHTML 5″</a> and  <a href="http://www.pinceladasdaweb.com.br/blog/2009/12/10/html-5-xml-xhtml-5/">Portuguese</a>.)</p>
<p>I like the <abbr>xhtml</abbr> syntax. It&#8217;s how I learned. I&#8217;m used to lowercase code, quoted attributes and trailing slashes on elements like <code>br</code> and <code>img</code>. They make me feel nice and comfy, like a cup of Ovaltine and <cite>The Evil Dead</cite> on the telly.</p>
<p>But you might not. You might want SHOUTY UPPERCASE tags, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#start-tags">no trailing slashes</a> and <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#attributes">attribute minimisation</a>. And, in <abbr>HTML</abbr> 5, you can choose</a>.</p>
<p>Thanks to the &#8220;<a href="http://www.w3.org/TR/html-design-principles/#pave-the-cowpaths">pave the cowpaths</a>&#8221; principle, it&#8217;s up to you. As you like it. What you will. Whatever you want, whatever you like.</p>
<p>But let no-one tell you that <abbr>HTML</abbr> 5 kills <abbr>XML</abbr>&mdash;meet <abbr>XHTML</abbr> 5.</p>
<p><abbr>XHTML</abbr> 5 is the <abbr>XML</abbr> serialisation of <abbr>HTML</abbr> 5 and, as you&#8217;d imagine, it has all the stricter parsing rules that you&#8217;d expect (and are used to if, like me, you grew up with <abbr>XHTML</abbr> DOCTYPES). It <strong>must</strong> be served  with an XML MIME type, such as application/xml or application/xhtml+xml (so no rendering in Internet Explorer for the moment) and will throw a wobbly at the slightest well-formedness violation. (See  <a href="http://www.webstandards.org/learn/articles/askw3c/sep2003/">Serving XHTML with the Right MIME Type</a> for more information.)</p>
<p>Usual <abbr>XML</abbr> rules apply: no <code>document.write</code>s allowed, no DOCTYPE required,  some syntax and script differences to trip up the unwary and you can use namespaces. </p>
<p>The main differences are summarised on the official <abbr>WHATWG</abbr> wiki <a href="http://wiki.whatwg.org/wiki/HTML_vs._XHTML">Differences Between HTML and XHTML</a>. It&#8217;s also possible to write <a href="http://dev.w3.org/html5/html-author/#polyglot-documents">polyglot documents</a> that can be processed as either by browsers, depending on the MIME type used.</p>
<p>Magne emailed the Doctor to ask &#8220;Is it OK to use HTML5 tags in a page with the XHTML 1.1 doctype? Which one  should  I use, as in, which one is the recommendation now?&#8221;</p>
<p>If you want to use the new features, you need to use <abbr>HTML</abbr> 5 DOCTYPE or <abbr>XHTML</abbr> 5. Given that Internet Explorer cannot process <abbr>XML</abbr>, for pragmatic reasons the Doctor advises <abbr>HTML</abbr> 5.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/absent-elements-and-validation/" rel="bookmark" class="crp_title">Absent Elements and Validation</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-2/" rel="bookmark" class="crp_title">Your questions answered #2</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-3/" rel="bookmark" class="crp_title">Your Questions Answered #3</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li>
<li><a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/" rel="bookmark" class="crp_title">How to get HTML5 working in IE and Firefox 2</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=HTML%205%20%2B%20XML%20%3D%20XHTML%205%20-%20http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;bodytext=%28Also%20available%20in%20Spanish%20Traducci%C3%B3n%20de%20%E2%80%9CHTML%205%20%2B%20XML%20%3D%20XHTML%205%E2%80%B3%20and%20%20Portuguese.%29%0D%0A%0D%0AI%20like%20the%20xhtml%20syntax.%20It%27s%20how%20I%20learned.%20I%27m%20used%20to%20lowercase%20code%2C%20quoted%20attributes%20and%20trailing%20slashes%20on%20elements%20like%20br%20and%20img.%20They%20make%20me%20feel" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;notes=%28Also%20available%20in%20Spanish%20Traducci%C3%B3n%20de%20%E2%80%9CHTML%205%20%2B%20XML%20%3D%20XHTML%205%E2%80%B3%20and%20%20Portuguese.%29%0D%0A%0D%0AI%20like%20the%20xhtml%20syntax.%20It%27s%20how%20I%20learned.%20I%27m%20used%20to%20lowercase%20code%2C%20quoted%20attributes%20and%20trailing%20slashes%20on%20elements%20like%20br%20and%20img.%20They%20make%20me%20feel" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;t=HTML%205%20%2B%20XML%20%3D%20XHTML%205" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;annotation=%28Also%20available%20in%20Spanish%20Traducci%C3%B3n%20de%20%E2%80%9CHTML%205%20%2B%20XML%20%3D%20XHTML%205%E2%80%B3%20and%20%20Portuguese.%29%0D%0A%0D%0AI%20like%20the%20xhtml%20syntax.%20It%27s%20how%20I%20learned.%20I%27m%20used%20to%20lowercase%20code%2C%20quoted%20attributes%20and%20trailing%20slashes%20on%20elements%20like%20br%20and%20img.%20They%20make%20me%20feel" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;t=HTML%205%20%2B%20XML%20%3D%20XHTML%205" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;title=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=%28Also%20available%20in%20Spanish%20Traducci%C3%B3n%20de%20%E2%80%9CHTML%205%20%2B%20XML%20%3D%20XHTML%205%E2%80%B3%20and%20%20Portuguese.%29%0D%0A%0D%0AI%20like%20the%20xhtml%20syntax.%20It%27s%20how%20I%20learned.%20I%27m%20used%20to%20lowercase%20code%2C%20quoted%20attributes%20and%20trailing%20slashes%20on%20elements%20like%20br%20and%20img.%20They%20make%20me%20feel" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;h=HTML%205%20%2B%20XML%20%3D%20XHTML%205" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-xml-xhtml-5%2F&amp;t=HTML%205%20%2B%20XML%20%3D%20XHTML%205&amp;s=%28Also%20available%20in%20Spanish%20Traducci%C3%B3n%20de%20%E2%80%9CHTML%205%20%2B%20XML%20%3D%20XHTML%205%E2%80%B3%20and%20%20Portuguese.%29%0D%0A%0D%0AI%20like%20the%20xhtml%20syntax.%20It%27s%20how%20I%20learned.%20I%27m%20used%20to%20lowercase%20code%2C%20quoted%20attributes%20and%20trailing%20slashes%20on%20elements%20like%20br%20and%20img.%20They%20make%20me%20feel" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/html-5-xml-xhtml-5/" rel="bookmark">HTML 5 + XML = XHTML 5</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 2, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html-5-xml-xhtml-5/feed/</wfw:commentRss>
		<slash:comments>61</slash:comments>
		</item>
		<item>
		<title>Designing a blog with html5</title>
		<link>http://html5doctor.com/designing-a-blog-with-html5/</link>
		<comments>http://html5doctor.com/designing-a-blog-with-html5/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 14:00:21 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[section]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=47</guid>
		<description><![CDATA[
			
				
			
		
Much of HTML 5&#8217;s feature set involves JavaScript APIs that make it easier to develop interactive web pages but there are a slew of new elements that allow you extra semantics in your conventional Web 1.0 pages. In order to investigate these, let&#8217;s look at marking up a blog.
Firstly what we&#8217;ll do is use the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Much of <abbr>HTML</abbr> 5&#8217;s feature set involves JavaScript <abbr>API</abbr>s that make it easier to develop interactive web pages but there are a slew of new elements that allow you extra semantics in your conventional Web 1.0 pages. In order to investigate these, let&#8217;s look at marking up a blog.</p>
<p>Firstly what we&#8217;ll do is use the <code>header</code>, <code>footer</code>, <code>and nav </code>elements to mark up the broad structure of the page. We&#8217;ll make the blog comments form much smarter by using the new data types and built-in validation available in <abbr>HTML</abbr> 5-aware browsers. </p>
<p>Then we&#8217;ll do some work on the guts of the page, using <abbr>HTML</abbr> 5&#8217;s <code>article</code> elements to better mark up blog posts and comments and show how to use the <code>section</code> elements to better structure accessible hierarchical headings on sites that are <abbr>CMS</abbr>-driven. As blogs are chronologically ordered, we&#8217;ll  see what <abbr>HTML 5</abbr> offers us for representing dates and times.</p>
<p>So take the phone of the hook, and make a cup of tea and we&#8217;ll get started.</p>
<p><section></p>
<h2>Setting the DOCTYPE</h2>
<p><abbr>HTML</abbr> 5, when used as plain <abbr>HTML</abbr> rather than its <abbr>XHTML</abbr> 5 sibling doesn&#8217;t need a DOCTYPE. But all browsers do, otherwise they go into <a href="http://en.wikipedia.org/wiki/Quirks_mode">Quirksmode</a>, which you don&#8217;t want: the collision of <abbr>HTML</abbr> 5 and Quirksmode is like matter and anti-matter meeting, and will cause a negative reality inversion that will make your underwear catch fire. </p>
<p>You&#8217;ve been warned, so at the top of your document, you need the line <code>&lt;!DOCTYPE html&gt;</code>.</p>
<p>Some sites &#8220;use&#8221; <abbr>HTML</abbr> 5, when in actual fact all they&#8217;ve done is take their existing code and change the DOCTYPE. That&#8217;s fine and dandy if you&#8217;ve been using valid, semantic code as <abbr>HTML</abbr> 5 is very similar to valid <abbr>HTML</abbr> 4.01. <a href="http://meyerweb.com/eric/thoughts/2009/01/02/an-event-apart-and-html-5/">Eric Meyer mentions small differences</a> like &#8220;not permitting a value attribute on an image submit&#8221;, and there are a few differences between the languages, summarised in the document <a href="http://dev.w3.org/html5/html4-differences/">HTML 5 differences from HTML 4</a>.</p>
<p>However, I don&#8217;t want simply to  rebadge my existing code, but to use some of the new structural elements now.</p>
<p></section><br />
<section></p>
<h2>Using some new structural elements</h2>
<p>My blog &#8211; like millions of others &#8211; has a header denoted by <code>&lt;div id="header"&gt;</code>, a footer <code>&lt;div id="footer"&gt;</code>, some articles (wrapped by an area called &#8220;content&#8221;, <code>&lt;div id="content"&gt;</code>) and some navigation (wrapped up in an area called &#8220;sidebar&#8221; <code>&lt;div id="sidebar"&gt;</code>). Most sites on the Web have similar constructs, although depending on your choice they might be called &quot;branding&quot; or &quot;info&quot; or &quot;menu&quot;, or you might use the equivalent words in your own language. </p>
<p>Although these all have very different functions within the page, they  use  the same generic <code>div</code> in the markup. as <abbr>HTML 4</abbr> has no other way to code them. <abbr>HTML</abbr> 5 has new elements for distinguishing  these logical areas: <code>header</code>, <code>nav</code>, <code>footer</code> and friends. (There&#8217;s  more on this in an artice by Lachlan Hunt on A List Apart: <a href="http://www.alistapart.com/articles/previewofhtml5">A Preview of <abbr>HTML</abbr> 5</a>.)</p>
<p>The overall aim is to replace this structure:</p>
<p><img src="/wp-content/uploads/2009/06/html5-before1.gif" alt="structure chart before redesign"></p>
<p>with this:</p>
<p><img src="/wp-content/uploads/2009/06/html5-after1.gif" alt="structure chart after redesign"></p>
<p>It&#8217;s a simple matter to change the <abbr>HTML</abbr> <code>div</code>s into the new elements. The only difficulty I had was deciding which element to use to mark up my sidebar, as it also includes a search field and &#8220;colophon&#8221; information as well as site-wide navigation. I decided against the <code>aside</code> element,  as <a href="http://dev.w3.org/html5/spec/Overview.html#the-aside-element">the spec says</a> it &#8220;represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content&#8221;, but it&#8217;s nevertheless <em>content</em> rather than navigation. So I decided to go for the <code>nav</code> element as the closest fit.</p>
<p>I&#8217;ve wrapped the main content in a <code>section</code> element (previously I&#8217;d kept it as a <code>div</code>). <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-section-element"><code>section</code> is defined</a> in the spec</p>
<blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-section-element"><p>The section element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading, possibly with a footer.</p></blockquote>
<p class="warning"><strong>Please note: I no longer recommend wrapping the whole content area in a <code>section</code> element, and suggest that you use a <code>div</code> element. Read more about <a href="/the-section-element">using section appropriately</a>.</strong></p>
<p>In this case, the &#8220;generic document section&#8221; is that of main content. I&#8217;ve retained an <code>id</code> so that a <a href="http://juicystudio.com/article/skip-links.php">skip links</a> feature will work, although I hope that in the future, assistive technology will offer an automatic way for people to go to the first <code>section</code> or <code>article</code>.</p>
<p>My fellow <abbr>HTML</abbr> 5 doctor, Remy Sharp, also notes  that if you retain the <code>div</code>, Internet Explorer without JavaScript would style the div, but none of the other content, making the site  very hard to read.</p>
<p></section><br />
<section></p>
<h2>New form attributes</h2>
<p>As well as the main structural item on the page, I&#8217;ve added some new attributes on <code>input</code> elements in the comments form.</p>
<p><abbr>HTML</abbr> 5 was designed to reflect what developers actually do rather than to reflect a philosophical purity, and that&#8217;s very clearly manifested in the new attributes which mean the browser takes up much of the work currently done by developers re-inventing validation routines in JavaScript. (Extending forms functionality was <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/introduction.html#history-0">how the <abbr>HTML</abbr> 5 spec began</a>).</p>
<p>So I amended the email input field in the comments to be <code>input type="email"</code> which means that when the user submits the form, an <abbr>HTML</abbr> 5-aware browser will use built-in validation routines to check that it&#8217;s in the correct format, without any JavaScript. Check it out in the current version of <a href="http://www.opera.com/">Opera</a>, as that the only full implementation at the time of writing (June 2009), and note that it also adds a &#8220;mail&#8221; icon in the input field as a cue to the user.</p>
<p>There are similar input validation routines triggered by some of the  new <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#attr-input-type"><code>input</code> types</a>, such as <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#url-state"><code>url</code></a> (which I use on the field that asks for the user&#8217;s web address), <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#number-state"><code>number</code></a> and <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#attr-input-pattern"><code>pattern</code></a> which compares the input with an arbitrary regular expression.</p>
<p>Another good example is <code>input type="date"</code>, which pops up a calendar widget/ date picker when the user focusses on the input field. You can <a href="http://people.opera.com/brucel/demo/html5-forms-demo.html">test the date picker</a>, or here&#8217;s a screenshot from Opera 9.6:</p>
<p><img src="/wp-content/uploads/2009/06/html5-form-date.gif" alt="date picker pops up next to input field"></p>
<p>A very useful new attribute I used on both <code>input</code> fields for commenter&#8217;s name and email address, and the comment <code>textarea</code> was <code>type="required"</code> which generates a message on submission if the fields are left blank. Each different localisation of a browser would need to have a different message, and it&#8217;s not (so far) customisable by the developer. </p>
<p><img src="/wp-content/uploads/2009/06/html5-required-feedback.gif" alt="red-bordered browser message 'You have to specify a value'" next to unfilled required field"></p>
<p>The good thing with all this new form fabulousness is it&#8217;s all formed around new attributes on an exisiting element, so people using older browsers just see a plain old <code>input</code> field.</p>
<p>    <section></p>
<h3>A note on screenreaders and <abbr>HTML 5</abbr></h3>
<p>I hope screenreaders are ready for these new interactions; I asked the html 5 group to formally <a href="http://lists.w3.org/Archives/Public/public-html/2007Jul/1249.html">invite screenreader vendors to participate</a> in the specification; to my knowledge, <a href="http://lists.w3.org/Archives/Public/public-html/2008Aug/0795.html">none have done so</a>.</p>
<p>    </section><br />
</section><br />
<section></p>
<h2>Laying out the new elements</h2>
<p>It&#8217;s not too hard to layout the new elements. In all the non-<abbr>IE</abbr> browsers, you can lay out anything using <abbr>CSS</abbr> &#8211; even a <a href="http://people.opera.com/brucel/demo/html5-nonsense-element.html">nonsense element</a>. One gotcha  is that that the current crop of browsers have no &#8220;knowledge&#8221; of these elements, although <a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)">support is improving all the time</a>.</p>
<p>All browsers have default settings for the elements they &#8220;know about&#8221;&mdash;how much padding, margin they element gets, does it display as a block or inline?. (Here&#8217;s a <a href="http://www.w3.org/TR/CSS2/sample.html">sample default stylesheet</a>.) Unless over-ridden by <abbr>CSS</abbr>, these defaults apply. But the browsers don&#8217;t know about <code>header</code>, <code>nav</code> and the like, so have no defaults to apply to them.</p>
<p>I got terrible rendering oddities until I explicitly told the browsers </p>
<pre><code>header, footer, nav, article {display:block;}</code></pre>
<p>    <section></p>
<h3><abbr>IE</abbr> layout</h3>
<p>There&#8217;s one gotcha about styling <abbr>HTML</abbr> 5 pages in <abbr>IE</abbr>: it doesn&#8217;t work. You can force it to quite easily with a JavaScript hack <code>document.createElement('element name')</code>. (Lachlan Hunt gets to the bottom of <a href="http://blog.whatwg.org/supporting-new-elements-in-ie">why IE needs this</a>.)</p>
<p>For your convenience, Remy Sharp has written an <a href="http://remysharp.com/2009/01/07/html5-enabling-script/"><abbr>HTML</abbr> 5 enabling script</a> which I use in the header to conjure all the missing elements into existence all at once.</p>
<p>But let&#8217;s be clear: <strong>this won&#8217;t work if your <abbr>IE</abbr> user doesn&#8217;t have JavaScript turned on</strong>. How much of that&#8217;s a big deal that is for you to decide. Pragmatically, it seems to me that the sites that will benefit the most from HTML 5’s new “Ajax”-style features, such as drag-and-drop, are the sites that currently have no hope of working without JavaScript. </p>
<p>    </section><br />
    <section></p>
<h3>Firefox 2 and Camino 1 layout</h3>
<p>Firefox 2 and Camino 1 both use Gecko 1.9 which has a bug and so gets grumpy if you don&#8217;t serve the page as <abbr>XHTML</abbr>. (Go figure; that&#8217;s almost enough to trigger a negative reality inversion and you know how bad that can be). However, Firefox and Camino users upgrade frequently so Firefox is in version 3, while Camino 2 beta is out, so the problem will soon cease to exist. (Read more at <a href="/how-to-get-html5-working-in-ie-and-firefox-2/">How to get HTML5 working in IE and Firefox 22</a> by Remy Sharp.)</p>
<p>    </section><br />
</section><br />
<section></p>
<h2>What&#8217;s the point of those new structural elements?</h2>
<p>Well, they add semantics to the page. The browser now knows which area of your site is the header or the footer because there are <code>header</code> and <code>footer</code> elements, whereas <code>div</code> might be called &#8220;branding&#8221; and &#8220;legal&#8221;, or even  &#8220;<span lang="fr">en-tete</span>&#8221; and &#8220;<span lang="fr">pied-de-page</span>&#8221; or &#8220;<span lang="de">kopfzeile</span>&#8221; and &#8220;<span lang="de">fusszeile</span>&#8220;.</p>
<p>But <em>so what</em>?</p>
<p>Robin Berjon expressed it beautifully in a <a href="http://www.alistapart.com/comments/semanticsinhtml5?page=2#12">comment on <cite>A List Apart</cite></a>: </p>
<blockquote cite="http://www.alistapart.com/comments/semanticsinhtml5?page=2#12">
<p>Pretty much everyone in the Web community agrees that “semantics are yummy, and will get you cookies”, and that’s probably true. But once you start digging a little bit further, it becomes clear that very few people can actually articulate a reason why. So before we all go another round on this, I have to ask: what’s it you wanna do with them darn semantics?</p>
<p>The general answer is “to repurpose content”. That’s fine on the surface, but you quickly reach a point where you have to ask “repurpose to what?” &hellip; I think <abbr>HTML</abbr> should add only elements that either expose functionality that would be pretty much meaningless otherwise (e.g. <code>canvas</code>) or that provide semantics that help repurpose for Web browsing uses.</p>
</blockquote>
<p>In my view, there are a couple of things I want to do with those semantics. The first is for search engine use; it&#8217;s easy to imagine Messrs Google or Yahoo! giving lower weighting to content in <code>footer</code> elements, or extra weight to content in the <code>header</code>. The second reason is to make the site navigable for people with disabilities. People with learning difficulties might instruct their browser always to put the articles before the navigation, for example. User agents might very well have a keyboard shortcut which jumped straight to the <code>nav</code> for example, or jumped straight past the navigation, in a programmatic implementation of &#8220;<a href="http://juicystudio.com/article/skip-links.php">skip links</a>&#8220;.</p>
<p>Which brings me to&hellip;</p>
<p></section><br />
<section></p>
<h2>Further refining the <abbr>HTML</abbr> 5 structure</h2>
<p><section></p>
<h3>The blog home page</h3>
<p>An interesting thing about a blog homepage is that there are generally the last 5 or so posts, each with a heading, a &quot;body&quot; and data about the post (time, who wrote it, how many comments etc.) and usually a link to another page that has the full blog post (if the homepage just showed an excerpt) and its comments.</p>
<p><abbr>HTML</abbr> 5 has an <a href="http://dev.w3.org/html5/spec/Overview.html#the-article-element"><code>article</code> element</a> which I use to wrap each story: </p>
<blockquote cite="http://dev.w3.org/html5/spec/Overview.html#the-article-element">
<p>The article element represents a section of a page that consists of a composition that forms an independent part of a document, page, or site. This could be a forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, or any other independent item of content.</p>
</blockquote>
<p>Let&#8217;s look in more detail at the guts of how I mark up each blogpost.</p>
<h3>Anatomy of a blog post</h3>
<p><img src="/wp-content/uploads/2009/06/html5-article-outline.gif" alt="diagram of article structure; explanation follows"></p>
<p>The wrapper is no longer a generic <code>div</code> but an <code>article</code>. Within that is a <code>header</code>, comprising a heading (the title of the blogpost) and then the time of publication,  marked up using the <code>time</code> element.</p>
<p>Then there are the pearls of wit and wisdom that consitute each of my posts, marked up as paragraphs, blockquotes etc., and is pulled unchanged out of the database. Following that is data about the blog post (category, how many comments) marked up as a footer and, in the case of pages that show a single blogpost, there are comments expressing undying admiration and love. Finally, there may be navigation from one article to the next.</p>
<p>    <section></p>
<h4>Data about the article</h4>
<p>Following the content there is some &#8220;metadata&#8221; about the post: what category it&#8217;s in, how many comments there are. I&#8217;ve marked this up as <code>footer</code>.  I previously used <a href="http://www.whatwg.org/specs/web-apps/current-work/#the-aside-element"><code>aside</code></a> which &#8220;represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content&#8221; but decided that it was too much of a stretch; data <em>about</em> a post is intimately related.</p>
<p><a href="http://www.whatwg.org/specs/web-apps/current-work/#the-footer-element"><code>footer</code></a> is a much better fit: &#8220;A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.&#8221; I was initially thrown off-course by the presentational name of the element; my use here isn&#8217;t at the bottom of the page, or even at the bottom of the article, but it certainly seems to fit the bill &#8211; it&#8217;s information about its section, containing author name, links to related documents (comments) and the like. There&#8217;s no reason that you can&#8217;t have more than one <code>footer</code> on page; the spec&#8217;s description says &quot;the footer element represents a footer for the section it applies to&quot; and a page may have any number of sections. The spec also says &quot;Footers don&#8217;t necessarily have to appear at the end of a section, though they usually do.&quot;</p>
<p>    </section><br />
    <section></p>
<h4>Comments</h4>
<p>I&#8217;ve marked up comments as <code>article</code>s, too, as the spec says that an <code>article</code> could be &#8220;a user-submitted comment&#8221;, but nested these inside the parent <code>article</code>. The spec says</p>
<blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element"><p>When article elements are nested, the inner article elements represent articles that are in principle related to the contents of the outer article. For instance, a Web log entry on a site that accepts user-submitted comments could represent the comments as article elements nested within the article element for the Web log entry.</p></blockquote>
<p>These are headed with the  date and the time of the comment and name of its author&mdash;if you want, you can wrap these in a <code>header</code>, too, but to me it seems like markup for the sake of it.</p>
<p>    </section><br />
    <section></p>
<h4>Times and dates</h4>
<p>Most blogs, news sites and the like provide dates of article publication.</p>
<p>Microformats people, the most vocal advocates of marking up dates and times, believe that  computer-formatted dates are best for people: their <a href="http://microformats.org/wiki/index.php?title=date-design-pattern&#038;diff=37974&#038;oldid=34166">wiki  says</a> &#8220;the ISO8601 YYYY-MM-DD format for dates is the best choice that is the most accurately readable for the most people worldwide, and thus the most accessible as well&#8221;. I don&#8217;t agree (and neither do candidates in my vox pop of non-geeks, my wife, brother and parents). </p>
<p>I do agree with the microformats people that <a href="http://microformats.org/wiki/principles">hidden metadata is not as good as visible, human-readable data</a> and therefore elected not to use the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element"><code>pubdate</code> attribute of <code>article</code></a>.</p>
<p>Therefore I&#8217;ve used the <abbr>HTML</abbr> 5 <code>time</code> element to give a  machine parsable date to computers, while giving people a human-readable date. Blog posts get the date, while comments get the date and time.</p>
<p>The spec is quite hard to understand, in my opinion, but the format you use is 2004-02-28T15:19:21+00:00, where T separates the date and the time, and the + (or a -) is the offset from <a href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time"><abbr>UTC</abbr></a>. Dates on their own don&#8217;t need a timezone; full datetimes do. Oddly, the spec suggests that if you use a time without a date, you don&#8217;t need a timezone either.</p>
<p>There&#8217;s considerable controversy over the time element at the moment. Recently one of the inner circle, <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-March/018687.html">Henri Sivonen, wrote</a> that it&#8217;s for marking up future events only and not for timestamping blogs or news items: &#8220;The expected use cases of hCalendar are mainly transferring <i>future</i> event entries from a Web page into an application like iCal.&quot; This seems very silly to me; if there is a <code>time</code> element, why not allow me to mark up any time or date? </p>
<p>The <a href="http://dev.w3.org/html5/spec/Overview.html#the-time-element">spec for <code>time</code></a> does not mention the future event-only restriction: &quot;The time element represents a precise date and/or a time in the proleptic Gregorian calendar&quot; and gives three examples, two of which are about the past and none of which are &quot;future events&quot;. Although the spec doesn&#8217;t (currently) limit use of the element, it does limit format to precise dates in &quot;the proleptic Gregorian calendar&quot;. This means I can mark up an archive page for &quot;all blog posts today&quot; using time, but not &quot;all July 2008 posts&quot; as that&#8217;s not a full YYYY-MM-DD date. Neither can you mark up precise, but ancient dates, so the date of Julius Ceasar&#8217;s assassination, <a href="http://en.wikipedia.org/wiki/Ides_of_March">15 March 44 <abbr>BC</abbr></a> is not compatible.</p>
<p>I don&#8217;t expect this to be resolved. If you think as I do, feel free to <a href="http://www.whatwg.org/mailing-list#specs">mail the Working Group</a> to express your feeling!</p>
<p>    </section><br />
</section></p>
<p>Hopefully, this brief article (geddit?) has given you a quick overview of how to use some of the new semantic elements. Let me know what you think!</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li>
<li><a href="http://html5doctor.com/native-drag-and-drop/" rel="bookmark" class="crp_title">Native Drag and Drop</a></li>
<li><a href="http://html5doctor.com/the-time-element/" rel="bookmark" class="crp_title">The time element (and microformats)</a></li>
<li><a href="http://html5doctor.com/the-section-element/" rel="bookmark" class="crp_title">The section element</a></li>
<li><a href="http://html5doctor.com/draw-attention-with-mark/" rel="bookmark" class="crp_title">Draw attention with mark</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Designing%20a%20blog%20with%20html5%20-%20http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5&amp;bodytext=Much%20of%20HTML%205%27s%20feature%20set%20involves%20JavaScript%20APIs%20that%20make%20it%20easier%20to%20develop%20interactive%20web%20pages%20but%20there%20are%20a%20slew%20of%20new%20elements%20that%20allow%20you%20extra%20semantics%20in%20your%20conventional%20Web%201.0%20pages.%20In%20order%20to%20investigate%20these%2C%20let%27s%20lo" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5&amp;notes=Much%20of%20HTML%205%27s%20feature%20set%20involves%20JavaScript%20APIs%20that%20make%20it%20easier%20to%20develop%20interactive%20web%20pages%20but%20there%20are%20a%20slew%20of%20new%20elements%20that%20allow%20you%20extra%20semantics%20in%20your%20conventional%20Web%201.0%20pages.%20In%20order%20to%20investigate%20these%2C%20let%27s%20lo" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Designing%20a%20blog%20with%20html5&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;t=Designing%20a%20blog%20with%20html5" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5&amp;annotation=Much%20of%20HTML%205%27s%20feature%20set%20involves%20JavaScript%20APIs%20that%20make%20it%20easier%20to%20develop%20interactive%20web%20pages%20but%20there%20are%20a%20slew%20of%20new%20elements%20that%20allow%20you%20extra%20semantics%20in%20your%20conventional%20Web%201.0%20pages.%20In%20order%20to%20investigate%20these%2C%20let%27s%20lo" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Designing%20a%20blog%20with%20html5&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;t=Designing%20a%20blog%20with%20html5" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;title=Designing%20a%20blog%20with%20html5&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Much%20of%20HTML%205%27s%20feature%20set%20involves%20JavaScript%20APIs%20that%20make%20it%20easier%20to%20develop%20interactive%20web%20pages%20but%20there%20are%20a%20slew%20of%20new%20elements%20that%20allow%20you%20extra%20semantics%20in%20your%20conventional%20Web%201.0%20pages.%20In%20order%20to%20investigate%20these%2C%20let%27s%20lo" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;h=Designing%20a%20blog%20with%20html5" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fdesigning-a-blog-with-html5%2F&amp;t=Designing%20a%20blog%20with%20html5&amp;s=Much%20of%20HTML%205%27s%20feature%20set%20involves%20JavaScript%20APIs%20that%20make%20it%20easier%20to%20develop%20interactive%20web%20pages%20but%20there%20are%20a%20slew%20of%20new%20elements%20that%20allow%20you%20extra%20semantics%20in%20your%20conventional%20Web%201.0%20pages.%20In%20order%20to%20investigate%20these%2C%20let%27s%20lo" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/designing-a-blog-with-html5/" rel="bookmark">Designing a blog with html5</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 30, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/designing-a-blog-with-html5/feed/</wfw:commentRss>
		<slash:comments>140</slash:comments>
		</item>
		<item>
		<title>How to get HTML5 working in IE and Firefox 2</title>
		<link>http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/</link>
		<comments>http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:05:45 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=134</guid>
		<description><![CDATA[
			
				
			
		HTML 5 may be the latest and greatest technology, but some browsers don&#8217;t have native support for the new semantic elements. Let&#8217;s momentarily forget about the really sexy functionality, like full control over the &#60;video&#62; element, and just focus on getting the elements rendered.

The problematic A-grade browsers include IE 8 and below, Firefox 2, and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p><abbr>HTML</abbr> 5 may be the latest and greatest technology, but <em>some</em> browsers don&#8217;t have native support for the new semantic elements. Let&#8217;s momentarily forget about the really sexy functionality, like <a href="http://html5doctor.com/the-video-element/">full control over the <code>&lt;video&gt;</code> element</a>, and just focus on getting the elements rendered.</p>

<p>The problematic <a href="http://developer.yahoo.com/yui/articles/gbs/">A-grade browsers</a> include <abbr>IE</abbr> 8 and below, Firefox 2, and Camino 1 (these last two browsers both use the Gecko rendering engine, which is why they&#8217;re both affected).</p>

<p>Let&#8217;s start with Internet Explorer.</p>

<span id="more-134"></span>

<h2><abbr>IE</abbr> doesn&#8217;t believe in <abbr>HTML</abbr> 5 elements</h2>

<p>Quite simply, <abbr>IE</abbr> doesn&#8217;t even <em>see</em> <abbr>HTML</abbr> 5 elements, much less style them.</p>

<p>This is actually the same issue that we had before <abbr>HTML</abbr> 5, where the <code>&lt;abbr&gt;</code> element couldn&#8217;t be styled in <abbr>IE</abbr> 6, resulting in <a href="http://www.sovavsiti.cz/css/abbr.html">all manner</a> of <a href="http://dean.edwards.name/my/abbr-cadabra.html">workarounds</a>. (Let me add that we&#8217;ll also fix the <code>&lt;abbr&gt;</code> element while we convince <abbr>IE</abbr> to recognise <abbr>HTML</abbr> 5 elements).</p>

<h3>The fix</h3>

<p>There is hope! The trick, discovered by <a href="http://intertwingly.net/blog/2008/01/22/Best-Standards-Support#c1201006277">Sjoerd Visscher</a>, is simply to create the new element using JavaScript, and <em lang="fr">voilà</em>, <abbr>IE</abbr> is able to style it:</p>

<pre><code>document.createElement('header');</code></pre>

<p>John Resig has also written about this <a href="http://ejohn.org/blog/html5-shiv/"><abbr>HTML</abbr> 5 shiv</a>.</p>

<p>For example, say you wanted to style the <code>&lt;time&gt;</code> element in italics:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Header test&lt;/title&gt;
  &lt;style&gt;
  time { font-style: italic; }
  &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;time datetime=&quot;2009-09-13&quot;&gt;my birthday&lt;/time&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>

<p>This screenshot shows the rendering in <abbr>IE</abbr> <a href="http://jsbin.com/urawa">before</a> we apply the fix:</p>

<p><img class="alignnone size-full wp-image-143" title="IE without HTML 5 shiv" src="http://html5doctor.com/wp-content/uploads/2009/06/ie-without.png" alt="IE without HTML 5 shiv" width="570" height="337" /></p>

<p>To apply the fix, add the indicated line of code:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;title&gt;Header test&lt;/title&gt;
  &lt;style&gt;
  time { font-style: italic; }
  &lt;/style&gt;
  
  &lt;!-- Add this line --&gt;
  &lt;script&gt;document.createElement('time');&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;time datetime=&quot;2009-09-13&quot;&gt;my birthday&lt;/time&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>

<p>Now <a href="http://jsbin.com/iduto">after</a> we&#8217;ve applied the fix, it&#8217;s correctly styled in <abbr>IE</abbr>:</p>

<p><img class="alignnone size-full wp-image-142" title="IE with HTML 5 shiv" src="http://html5doctor.com/wp-content/uploads/2009/06/ie-with.png" alt="IE with HTML 5 shiv" width="565" height="327" /></p>

<h3>One hit solution</h3>

<p>For everyone&#8217;s convenience, I wrote a single JavaScript file that can be included to create all the <abbr>HTML</abbr> 5 elements (and the <code>&lt;abbr&gt;</code> element) for <abbr>IE</abbr>.</p>

<p><a href="http://remysharp.com/downloads/html5.js">Download the <abbr>IE</abbr> <abbr>HTML</abbr> 5 enabling script</a></p>

<p>Include the script in your <code>&lt;head&gt;</code> tag, and you&#8217;ll be able to style the elements appropriately in <abbr>IE</abbr>:</p>

<pre><code>&lt;!--[if lte IE 8]&gt;
&lt;script src=&quot;html5.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</code></pre>

<p>Note that I&#8217;ve used a conditional comment to only apply this to <abbr>IE</abbr> 8 and below. It&#8217;s my hope that <abbr>IE</abbr> 9 and onwards will support <abbr>HTML</abbr> 5 elements, but when that day comes, make sure to double check the conditional!</p>

<h3>Conditions &amp; Gotchas</h3>

<p>There are a couple of things to be aware of when using the HTML 5 shiv.</p>

<h4>JavaScript required</h4>

<p>This obviously means that your design now depends on JavaScript. Personally, I feel that if you&#8217;ve used semantic markup for your site and the elements can&#8217;t be styled, the content is still completely readable.</p>

<p>Here&#8217;s a screenshot of the <a href="http://2009.full-frontal.org/">Full Frontal</a> web site, written using <abbr>HTML</abbr> 5 elements, rendered in <abbr>IE</abbr> with and without JavaScript enabled:</p>

<p><img class="alignnone size-full wp-image-141" title="IE with and without JavaScript to fix HTML 5" src="http://html5doctor.com/wp-content/uploads/2009/06/ie-js-fix-compare.png" alt="IE with and without JavaScript to fix HTML 5" width="600" height="304" /></p>

<p>You can see in the second screenshot that the content isn&#8217;t perfect, but it&#8217;s still readable &mdash; it cascades down correctly, much as if <abbr>CSS</abbr> were disabled.</p>

<h4 id="a-little-head">A little head is always good</h4>

<p>If you create the new element and <em>don&#8217;t</em> use a <code>&lt;body&gt;</code> tag (which is perfectly valid <abbr>HTML</abbr> 5), <abbr>IE</abbr> will put all those created elements inside the <code>&lt;head&gt;</code> tag. Pretty crazy, but you can easily avoid this by always using both the <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> tags in your markup. <a href="http://blog.whatwg.org/supporting-new-elements-in-ie#comment-40743">Leif Halvard explains further with demos.</a></p>

<h2>Firefox 2 and Camino 1 rendering bug</h2>

<p>Both Firefox 2 and Camino 1 have a bug in the Gecko rendering engine (specifically versions prior to 1.9b5):</p>

<blockquote><p>Firefox 2 (or any other Gecko-based browser with a Gecko version pre 1.9b5) has a parsing bug where it will close an unknown element when it sees the start tag of a &#8220;block&#8221; element p, h1, div, and so forth.</p></blockquote>

<p>According to the <a href="http://www.w3schools.com/browsers/browsers_firefox.asp">W3 Schools stats</a>, Firefox 2 only has around 3% of the market &mdash; perhaps low enough to justify ignoring it. It&#8217;s safe to assume that Camino 1 commands an even smaller percentage of the market.</p>

<p>By ignoring this issue, however, a site can look quite bad in these browsers. So how can we fix it?</p>

<p>The bug surfaces when Gecko doesn&#8217;t recognise an element. Explained roughly, when Gecko parses an unrecognised element, it removes the element&#8217;s contents and puts them next to the element.</p>

<p>Take, for example, the following code:</p>

<pre><code>&lt;body&gt;
  &lt;header&gt;&lt;h1&gt;Title&lt;/h1&gt;&lt;/header&gt;
  &lt;article&gt;&lt;p&gt;...&lt;/p&gt;&lt;/article&gt;
&lt;/body&gt;</pre></code>

<p>This will be parsed in Gecko (prior to version 1.9b5) as if the markup were actually as follows:</p>

<pre><code>&lt;body&gt;
  &lt;header&gt;&lt;/header&gt;
  &lt;h1&gt;Title&lt;/h1&gt;
  &lt;article&gt;&lt;/article&gt;
  &lt;p&gt;...&lt;/p&gt;
&lt;/body&gt;</code></pre>

<p>The visual result is similar to the above screenshot of <abbr>IE</abbr> running without JavaScript (though subtly different, as the DOM tree is actually in a different order than you as the author intended).</p>

<h3>The fix</h3>

<p>There are two approaches to fixing this issue, and so far I've only successfully used the non-JavaScript approach.</p>

<h4>The JavaScript solution</h4>

<p>The first approach is to use JavaScript to traverse the DOM tree, rearranging elements as issues are encountered. Simon Pieters has a <a href="http://blog.whatwg.org/supporting-new-elements-in-firefox-2">small working example</a> of how this can be done (towards the bottom of the page). In practise, however, I <em>personally</em> found it didn't work for my markup. The problem is definitely solvable using JavaScript, but this solution still needs work to handle all permutations of markup.</p>

<h4>The <abbr>XHTML</abbr> solution</h4>

<p>The second approach is to serve Gecko XHTML. I've found this to be the easier approach if you're either generating a page dynamically (using something like PHP) or if you can create your own <code>.htaccess</code> file to use Apache's <code>mod_rewrite</code>.</p>

<p>The first change to your markup is to add the <code>xmlns</code> attribute to your <code>&lt;html&gt;</code> tag:</p>

<pre><code>&lt;html lang=&quot;en&quot; xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</code></pre>

<p>Next, we need to sniff the user agent string (typically a bad approach, but justifiable when targeting such a specific group of users). If the Gecko build is less than 1.9, then we need to set the Content-type header to <code>application/xhtml+xml</code>.</p>

<p>If you want to use <code>mod_rewrite</code> in an <code>.htaccess</code> file (or the <code>httpd.conf</code> file), you need the following rules:</p>

<pre><code>RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{HTTP_USER_AGENT} rv:1\.(([1-8]|9pre|9a|9b[0-4])\.[0-9.]+).*Gecko
RewriteRule .* - [T=application/xhtml+xml]</code></pre>

<p>This rule sends the proper Content-type header to all Gecko based browsers where version is less than 1.9, or "rv:1.9pre" or "rv:1.9a" or "rv:1.9b<em>x</em>" where <em>x</em> is less than 5.</p>

<p>If you don't want to use the <code>mod_rewrite</code> approach, you'll need to manually send the header in your server side scripts. Here's a solution for a PHP script:</p>

<pre><code>if (preg_match('/rv:1\.(([1-8]|9pre|9a|9b[0-4])\.[0-9.]+).*Gecko/', $_SERVER['HTTP_USER_AGENT'])) {
  header('Content-type: application/xhtml+xml');
}</code></pre>

<p>This snippet needs to be included <em>before</em> anything has been printed by your script &mdash; i.e., as early as possible.</p>

<h3>Gotcha: Yellow Screen of Death</h3>

<p>The Yellow Screen of Death shows up whenever there's an <abbr>XML</abbr> error on the page. If we're serving markup as <abbr>XML</abbr> and telling the browser to interpret it strictly as <abbr>XML</abbr>, then we can't serve any characters it doesn't recognise or else it's going to bork:</p>

<p><img src="http://upload.wikimedia.org/wikipedia/commons/4/48/Yellow_screen_of_death.png" alt="Yellow Screen of Death" /></p>

<p>Below are a few ways to avoid <abbr>XML</abbr> parsing errors.</p>

<h4>Create strict markup</h4>

<p>You need to ensure your markup is squeaky clean &mdash; but that's easy, because you're already a Markup Jedi, right?</p>

<h4>Use <abbr>XML</abbr> entities</h4>

<p><abbr>HTML</abbr> entities are a no-no. Sorry, but <code>&amp;bull;</code> isn't going to fly anymore. You need to use <abbr>XML</abbr> entities, the numerical representation of these characters.</p>

<p>I've built <a href="http://leftlogic.com/lounge/articles/entity-lookup/">an entity lookup tool</a> that shows the <abbr>HTML</abbr> entity and the <abbr>XML</abbr> value of that entity. For example, <code>&amp;bull;</code> is 8226, so the XML entity is <code>&amp;#8226;</code>.</p>

<h4>Sanitise user generated content</h4>

<p>If your site relies on any user generated content (e.g., blog comments), then you need to sanitise the output to ensure there are no validation issues to trigger the Yellow Screen of Death.</p>

<p>This issue alone may justify further investigation of a JavaScript solution.</p>

<h3>Worth the trouble?</h3>

<p>All that said, Firefox has a very good automated upgrade path. Looking at the <a href="http://www.w3schools.com/browsers/browsers_firefox.asp">stats on W3Schools</a>, it's safe to say that the number of users with this Gecko bug is rapidly diminishing.</p>

<h2>Further reading</h2>

<ul>
<li><a href="http://blog.whatwg.org/supporting-new-elements-in-firefox-2">Firefox 2 rendering issue on WHATWG Blog</a></li>
<li><a href="http://blog.whatwg.org/supporting-new-elements-in-ie#comment-40743"><abbr>IE</abbr> / missing head tag issue</a></li>
<li><a href="http://ejohn.org/blog/html5-shiv/"><abbr>HTML</abbr> 5 shiv</a></li>
<li><a href="http://remysharp.com/2009/01/07/html5-enabling-script/"><abbr>HTML</abbr> 5 enabling script</a></li>
</ul>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/html-5-boilerplates/" rel="bookmark" class="crp_title">HTML5 Boilerplates</a></li><li><a href="http://html5doctor.com/legend-not-such-a-legend-anymore/" rel="bookmark" class="crp_title">Legend not such a legend anymore</a></li><li><a href="http://html5doctor.com/dd-details-wrong-again/" rel="bookmark" class="crp_title">dd-details wrong again</a></li><li><a href="http://html5doctor.com/native-drag-and-drop/" rel="bookmark" class="crp_title">Native Drag and Drop</a></li><li><a href="http://html5doctor.com/designing-a-blog-with-html5/" rel="bookmark" class="crp_title">Designing a blog with html5</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202%20-%20http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;bodytext=HTML%205%20may%20be%20the%20latest%20and%20greatest%20technology%2C%20but%20some%20browsers%20don%27t%20have%20native%20support%20for%20the%20new%20semantic%20elements.%20Let%27s%20momentarily%20forget%20about%20the%20really%20sexy%20functionality%2C%20like%20full%20control%20over%20the%20%26lt%3Bvideo%26gt%3B%20element%2C%20and%20just%20focu" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;notes=HTML%205%20may%20be%20the%20latest%20and%20greatest%20technology%2C%20but%20some%20browsers%20don%27t%20have%20native%20support%20for%20the%20new%20semantic%20elements.%20Let%27s%20momentarily%20forget%20about%20the%20really%20sexy%20functionality%2C%20like%20full%20control%20over%20the%20%26lt%3Bvideo%26gt%3B%20element%2C%20and%20just%20focu" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;t=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;annotation=HTML%205%20may%20be%20the%20latest%20and%20greatest%20technology%2C%20but%20some%20browsers%20don%27t%20have%20native%20support%20for%20the%20new%20semantic%20elements.%20Let%27s%20momentarily%20forget%20about%20the%20really%20sexy%20functionality%2C%20like%20full%20control%20over%20the%20%26lt%3Bvideo%26gt%3B%20element%2C%20and%20just%20focu" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;t=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;title=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=HTML%205%20may%20be%20the%20latest%20and%20greatest%20technology%2C%20but%20some%20browsers%20don%27t%20have%20native%20support%20for%20the%20new%20semantic%20elements.%20Let%27s%20momentarily%20forget%20about%20the%20really%20sexy%20functionality%2C%20like%20full%20control%20over%20the%20%26lt%3Bvideo%26gt%3B%20element%2C%20and%20just%20focu" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;h=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fhow-to-get-html5-working-in-ie-and-firefox-2%2F&amp;t=How%20to%20get%20HTML5%20working%20in%20IE%20and%20Firefox%202&amp;s=HTML%205%20may%20be%20the%20latest%20and%20greatest%20technology%2C%20but%20some%20browsers%20don%27t%20have%20native%20support%20for%20the%20new%20semantic%20elements.%20Let%27s%20momentarily%20forget%20about%20the%20really%20sexy%20functionality%2C%20like%20full%20control%20over%20the%20%26lt%3Bvideo%26gt%3B%20element%2C%20and%20just%20focu" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/" rel="bookmark">How to get HTML5 working in IE and Firefox 2</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 20, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/feed/</wfw:commentRss>
		<slash:comments>95</slash:comments>
		</item>
	</channel>
</rss>
