<?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>Wed, 01 Feb 2012 09:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Document Outlines</title>
		<link>http://html5doctor.com/outlines/</link>
		<comments>http://html5doctor.com/outlines/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 14:57:06 +0000</pubDate>
		<dc:creator>Mike Robinson</dc:creator>
				<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[outline]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3433</guid>
		<description><![CDATA[<p>Document outlines have changed a bit in HTML5. For a start, they’re actually in the spec! The HTML5 Doctor is here to explain what document outlines are, how to make good ones, and why you should care.</p>]]></description>
			<content:encoded><![CDATA[<p>Document outlines have changed a bit in HTML5. For a start, they’re actually in the spec! The HTML5 Doctor is here to explain what document outlines are, how to make good ones, and why you should care.</p>

<section id="what-are-outlines">
  <h2>What are document outlines? <a class="permalink" href="#what-are-outlines">#</a></h2>
  
  <p>The document outline is the structure of a document, generated by the document’s headings, form titles, table titles, and any other appropriate landmarks to <a href="http://www.w3.org/TR/2002/REC-UAAG10-20021217/guidelines#tech-provide-outline-view">map out the document</a>. The user agent can apply this information to generate a table of contents, for example. This table of contents could then be used by assistive technology to help the user, or be parsed by a machine like a search engine to improve search results.</p>
  
  <p>The outlining algorithm has been clearly defined in the <a href="http://dev.w3.org/html5/spec/Overview.html#outlines">HTML5 spec</a>, so once all browsers and assistive technologies play ball, there will be some major accessibility wins (more on <a href="#real-world-outlines">support</a> later). Before we take a look at how this new algorithm works, it’s time for a quick walk down memory lane.</p>
</section>

<section id="outlines-in-html4">
  <h2>Outlines in HTML4 <a class="permalink" href="#outlines-in-html4">#</a></h2>
  
  <p>Creating document outlines prior to HTML5 was simple. You had six heading elements, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code>. Lower-numbered headings were of a higher rank of higher-numbered ones — i.e. <code>&lt;h1&gt;</code> was ranked higher than <code>&lt;h2&gt;</code>:</p>

  <pre><code>&lt;h1&gt;My fantastic site&lt;/h1&gt;
&lt;h2&gt;About me&lt;/h2&gt;
&lt;p&gt;I am a man who lives a fascinating life. Oh the stories I could tell you...&lt;/p&gt;
&lt;h3&gt;What I do for a living&lt;/h3&gt;
&lt;p&gt;I sell enterprise-managed ant farms.&lt;/p&gt;
&lt;h2&gt;Contact&lt;/h2&gt;
&lt;p&gt;Shout my name and I will come to you.&lt;/p&gt;
</code></pre>

  <p>This example would produce the following outline:</p>
  <div class="callout">
  <ol>
    <li>
      My fantastic site
      <ol>
        <li>
          About me
          <ol>
            <li>What I do for a living</li>
          </ol>
        </li>
        <li>Contact</li>
      </ol>
    </li>
  </ol>
</div>

  <p>The <code>&lt;h2&gt;</code> titles are children of the <code>&lt;h1&gt;</code>, and the &#8220;About me&#8221; content has a further sub-heading using an <code>&lt;h3&gt;</code>. It’s simple but restrictive, as you have to ensure the heading levels are appropriate for the intended structure, and you’re limited to six levels. The latter restriction is usually not such a problem, but it still exists for all you heading fanatics (oh you guys!).</p>

  <p>HTML5 does this as well. The above example would produce the same outline, but it can be taken even further using the new sectioning elements.</p>
</section>

<section id="sectioning-elements">
  <h2>Sectioning elements <a class="permalink" href="#sectioning-elements">#</a></h2>
  
  <p>The concepts behind HTML5 document outlines are actually older than you might think! Tim Berners-Lee posted to the www-talk mailing list <a href="http://lists.w3.org/Archives/Public/www-talk/1991SepOct/0003.html">back in 1991</a> (props to <a href="http://html5doctor.com/author/olib/">Dr Oli</a> for digging that up), suggesting something quite close to what is demonstrated in this article.</p>

  <p>The sectioning elements <a href="/section/"><code>&lt;section&gt;</code></a>, <a href="/article/"><code>&lt;article&gt;</code></a>, <a href="/aside/"><code>&lt;aside&gt;</code></a> and <a href="/nav/"><code>&lt;nav&gt;</code></a> can all help to create a more logical structure in the document outline. Let&#8217;s go crazy and rewrite our previous example using only <code>&lt;h1&gt;</code> elements for headings:</p>

  <pre><code>&lt;h1&gt;My fantastic site&lt;/h1&gt;
&lt;h1&gt;About me&lt;/h1&gt;
&lt;p&gt;I am a man who lives a fascinating life. Oh the stories I could tell you...&lt;/p&gt;
&lt;h1&gt;What I do for a living&lt;/h1&gt;
&lt;p&gt;I sell enterprise-managed ant farms.&lt;/p&gt;
&lt;h1&gt;Contact&lt;/h1&gt;
&lt;p&gt;Shout my name and I will come to you.&lt;/p&gt;
</code></pre>

  <p>The outline would now look like this:</p>
<div class="callout">
  <ol>
    <li>My fantastic site</li>
    <li>About me</li>
    <li>What I do for a living</li>
    <li>Contact</li>
  </ol>
</div>
  <p>Clearly, that’s no good — we&#8217;ve lost our structure! With sectioning elements, we can make it look like before without changing those headings. In this particular example, I think <code>&lt;section&gt;</code> is most appropriate:</p>

  <pre><code>&lt;h1&gt;My fantastic site&lt;/h1&gt;
&lt;section&gt;
  &lt;h1&gt;About me&lt;/h1&gt;
  &lt;p&gt;I am a man who lives a fascinating life. Oh the stories I could tell you...&lt;/p&gt;
  &lt;section&gt;
    &lt;h1&gt;What I do for a living&lt;/h1&gt;
    &lt;p&gt;I sell enterprise-managed ant farms.&lt;/p&gt;
  &lt;/section&gt;
&lt;/section&gt;
&lt;section&gt;
  &lt;h1&gt;Contact&lt;/h1&gt;
  &lt;p&gt;Shout my name and I will come to you.&lt;/p&gt;
&lt;/section&gt;
</code></pre>

  <p>Run it through the outliner and we’re back to normal:</p>
<div class="callout">
  <ol>
    <li>
      My fantastic site
      <ol>
        <li>
          About me
          <ol>
            <li>What I do for a living</li>
          </ol>
        </li>
        <li>Contact</li>
      </ol>
    </li>
  </ol>
</div>
  <p>But why? The sectioning elements act quite literally as their name suggests: <em>they define sections of the parent element</em>. These sections can be thought of as child nodes whose headings fall under their parent heading, regardless of their rank. The following example illustrates this further:</p>

  <pre><code>&lt;h2&gt;HTML5 Doctor articles&lt;/h2&gt;
&lt;article&gt;
  &lt;h1&gt;The section element&lt;/h1&gt;
  &lt;p&gt;We doctors are a bunch of chums using HTML5 and writing about how we do it...&lt;/p&gt;
&lt;/article&gt;
&lt;article&gt;
  &lt;h1&gt;The article element&lt;/h1&gt;
  &lt;p&gt;We’ve discussed a lot of new elements here at HTML5Doctor...&lt;/p&gt;
&lt;/article&gt;
</code></pre>

  <p>Even though the articles contain <code>&lt;h1&gt;</code>s, this produces the following outline: </p>

<div class="callout">
  <ol>
    <li>
      HTML5 Doctor articles
      <ol>
        <li>The section element</li>
        <li>The article element</li>
      </ol>
    </li>
  </ol>
</div>  

  <p>Equally, owing to how the outliner works, the following examples
(while probably not the best use of headings) produce the exact same above outline:</p>
  
    <figure>
      <pre><code>&lt;h1&gt;HTML5 Doctor articles&lt;/h1&gt;
&lt;article&gt;
  &lt;h3&gt;The section element&lt;/h3&gt;
&lt;/article&gt;
&lt;article&gt;
  &lt;h3&gt;The article element&lt;/h3&gt;
&lt;/article&gt;
</code></pre>
    </figure>
  
  <figure>
    <pre><code>&lt;h2&gt;HTML5 Doctor articles&lt;/h2&gt;
&lt;article&gt;
  &lt;h2&gt;The section element&lt;/h2&gt;
&lt;/article&gt;
&lt;article&gt;
  &lt;h2&gt;The article element&lt;/h2&gt;
&lt;/article&gt;
</code></pre>
  </figure>

  <figure>
    <pre><code>&lt;h6&gt;HTML5 Doctor articles&lt;/h6&gt;
&lt;article&gt;
  &lt;h1&gt;The section element&lt;/h1&gt;
&lt;/article&gt;
&lt;article&gt;
  &lt;h1&gt;The article element&lt;/h1&gt;
&lt;/article&gt;
</code></pre>
  </figure>
  
  <p>When choosing which heading to use in your documents, <a href="http://www.whatwg.org/specs/web-apps/current-work/complete/sections.html#headings-and-sections">the spec</a> has recommendations:</p>

<blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/complete/sections.html#headings-and-sections">
<p>Sections may contain headings of any rank, but authors are strongly encouraged to either use only h1 elements, or to use elements of the appropriate rank for the section’s nesting level.</p>
<footer>— <cite><a href="http://www.whatwg.org/specs/web-apps/current-work/complete/sections.html#headings-and-sections" title="4.4.11 Headings and sections">WHATWG HTML5 specification</a></cite></footer></blockquote>

  <p>You should also make sure you’re aware of how differently ranked headings work when used as direct children of a sectioning element. It&#8217;s how it worked prior to HTML5:</p>

  <blockquote cite="http://www.whatwg.org/specs/web-apps/current-work/complete/sections.html#headings-and-sections"><p>The first element of heading content in an element of sectioning content represents the heading for that section. Subsequent headings of equal or higher rank start new (implied) sections, headings of lower rank start implied subsections that are part of the previous one. In both cases, the element represents the heading of the implied section.</p>
<footer>— <cite><a href="http://www.whatwg.org/specs/web-apps/current-work/complete/sections.html#headings-and-sections" title="4.4.11 Headings and sections">WHATWG HTML5 specification</a></cite></footer></blockquote>

  <section id="untitled-sections">
    <h3>Untitled sections <a class="permalink" href="#untitled-sections">#</a></h3>

    <p>Sectioning elements that do not contain a child heading will be labelled as “Untitled”, indicating the lack of a logical heading but preserving the outline as in the example below:</p>
    
    <figure>
      <pre><code>&lt;aside&gt;
  &lt;section&gt;
    &lt;h2&gt;Twitter&lt;/h2&gt;
  &lt;/section&gt;
  &lt;section&gt;
    &lt;h2&gt;Recent comments&lt;/h2&gt;
  &lt;/section&gt;
&lt;/aside&gt;
</code></pre>
    </figure>
    
    <p>Running this through the outliner produces this outline:</p>
    <div class="callout">
    <ol>
      <li>
        Untitled <code>aside</code>
        <ol>
          <li>Twitter</li>
          <li>Recent comments</li>
        </ol>
      </li>
    </ol>
    </div>
    
    <p>The outliner has taken the liberty of flagging the sectioning element as untitled, to act as a warning and to preserve a logical structure. For accessibility reasons, we recommend each sectioning element have a heading, even <code>&lt;aside&gt;</code> and <code>&lt;nav&gt;</code>, as shown below. If you don’t want these headings to be visible, you can always hide them with CSS.</p>

    <figure>
      <pre><code>&lt;aside&gt;
  &lt;h1&gt;What you're saying&lt;/h1&gt;
  &lt;section&gt;
    &lt;h2&gt;Twitter&lt;/h2&gt;
  &lt;/section&gt;
  &lt;section&gt;
    &lt;h2&gt;Recent comments&lt;/h2&gt;
  &lt;/section&gt;
&lt;/aside&gt;
</code></pre>
    </figure>

<p>Remember, elements like <code>&lt;section&gt;</code> should not be used arbitrarily. See our <a href="http://html5doctor.com/the-section-element/">section article</a> for more.</p>
  </section>
</section>

<section id="using-hgroup">
  <h2>How does <code>&lt;hgroup&gt;</code> affect the outline? <a class="permalink" href="#using-hgroup">#</a></h2>
  
  <p>As Dr Richard Clark said in <a href="http://html5doctor.com/the-hgroup-element/">our <code>&lt;hgroup&gt;</code> article</a>, <code>&lt;hgroup&gt;</code> is <q cite="http://html5doctor.com/the-hgroup-element/">all about the document outline</q>. The outliner will disregard all headings within <code>&lt;hgroup&gt;</code> except the one with the highest ranking. For example, if an <code>&lt;hgroup&gt;</code> contains an <code>&lt;h2&gt;</code>, an <code>&lt;h3&gt;</code> and an <code>&lt;h4&gt;</code>, only the <code>&lt;h2&gt;</code>’s text will be used as the section title in the outline. For example, the following markup:</p>

<pre><code>&lt;article&gt;
  &lt;hgroup&gt;
    &lt;h1&gt;Title goes here&lt;/h1&gt;
    &lt;h2&gt;Subtitle of article&lt;/h2&gt;
  &lt;/hgroup&gt;
  &lt;p&gt;Lorem Ipsum dolor set amet&lt;/p&gt;
&lt;/article&gt;</code></pre>

<p>Would produce the following outline.</p>

    <div class="callout">
    <ol>
      <li>Title goes here</li>
    </ol>
    </div>

  <p>At the time of writing, <code>&lt;hgroup&gt;</code>&#8217;s future is a little uncertain. It was recently <a href="http://html5doctor.com/the-hgroup-hokey-cokey/">removed and then returned</a> to the HTML5 spec, and there are <a href="http://www.w3.org/html/wg/wiki/ChangeProposals/dropHgroup">proposals</a> for its removal or replacement with an alternative. We&#8217;ll be sure to keep HTML5 Doctor up-to-date with any changes as they unfold.</p>
</section>

<section id="sectioning-roots">
  <h2>Sectioning roots <a class="permalink" href="#sectioning-roots">#</a></h2>
  
  <p>Sectioning roots, introduced in HTML5, isolate certain parts of a document to their own separate outlines. Headings within these elements will not show up in the main outline, where the sectioning root element is the <code>&lt;body&gt;</code>.</p>

  <p>The other sectioning root elements are <code>&lt;blockquote&gt;</code>, <code>&lt;figure&gt;</code>, <code>&lt;details&gt;</code>, <code>&lt;fieldset&gt;</code>, and <code>&lt;td&gt;</code>. Each one of these elements is a descendant of the <code>&lt;body&gt;</code> element, but its headings are removed from the top-level outline, instead starting its own isolated outline.</p>
  
  <figure>
    <pre><code>&lt;h1&gt;Top of the outline&lt;/h1&gt;

&lt;section&gt;
  &lt;h2&gt;A heading in the outline&lt;/h2&gt;
  &lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;
&lt;/section&gt;
&lt;section&gt;
  &lt;h2&gt;Another heading in the outline&lt;/h2&gt;
  &lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;
  &lt;blockquote&gt;
    &lt;h1&gt;This quoted heading will not appear in the outline&lt;/h1&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;
  &lt;/blockquote&gt;
&lt;/section&gt;
</code></pre>
  </figure>
  
  <p>This results in the following outline. Notice that it lacks the <code>&lt;blockquote&gt;</code>’s heading, which has been isolated:</p>
<div class="callout">
  <ol>
    <li>
      Top of the outline
      <ol>
        <li>A heading in the outline</li>
        <li>Another heading in the outline</li>
      </ol>
    </li>
  </ol>
</div>
</section>

<section id="real-world-outlines">
  <h2>Outlines in the real world <a class="permalink" href="#real-world-outlines">#</a></h2>
    
  <p>Unfortunately, there is little support for the new outlining algorithms right now. Search engines may be experimenting with it in their crawling algorithms as you read this, but as far as we know, headings are treated just as they were before. You won’t be penalised for using them, even if you use <a href="http://www.youtube.com/watch?v=GIn5qJKU8VM">multiple <code>&lt;h1&gt;</code>s</a> (which have always been okay as far as the spec is concerned). Check out our <a href="http://html5doctor.com/html5-seo-search-engine-optimisation/">HTML5 and Search Engine Optimisation</a> article for more on search engines and HTML5.</p>
  
  <p>At the time of writing, screen readers do not support these new outlines, so if you do use multiple <code>&lt;h1&gt;</code>s in your documents, it may confuse your users. It’s best if you use logical heading levels — <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code> — at least until the new outlines are more widely supported.</p>

  <p>As for browsers, both recent releases of Firefox and Chrome have a user agent styles that support HTML5 document outlines. Try this <a href="http://jsbin.com/ijixib">bare-bones example</a> in the latest Chrome or Firefox.</p>
</section>

<section id="conclusion">
  <h2>Final thoughts <a class="permalink" href="#conclusion">#</a></h2>
  
  <p>Despite the spotty support, it’s definitely worth thinking carefully about your document outlines so you’re prepared for the future, and tune in here for news of improved support.</p>
  
  <p>Get to grips with the sectioning elements and sectioning roots and how each affects the outline. When marking up a new site, consider how you could take advantage of the new document outline algorithm. As user agent support strengthens, pages you made with your new-found knowledge of document outlines will be more accessible. Let us know what you think in the comments below!</p>
  
  <section id="outliners">
    <h3>Outliner tools <a class="permalink" href="#outliners">#</a></h3>

    <p>In order to test your outlines, you’ll need an outliner. Here are a few options to get you started:</p>
    
    <ul>
      <li><a href="http://code.google.com/p/h5o/">h5o</a>, a Javascript implementation of the outliner, available as a bookmarklet, extension, or minified JavaScript file</li>
      <li><a href="https://addons.opera.com/addons/extensions/details/html5-outliner/1.0/">An Opera extension</a></li>
      <li><a href="http://gsnedders.html5.org/outliner/">An online outliner</a> where you can upload a file or submit a URL or HTML source to parse (may no longer be under development)</li>
    </ul>
  </section>
</section><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/the-hgroup-element/" rel="bookmark" class="crp_title">The hgroup element</a></li><li><a href="http://html5doctor.com/the-hgroup-hokey-cokey/" rel="bookmark" class="crp_title">The hgroup hokey cokey</a></li><li><a href="http://html5doctor.com/your-questions-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</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/the-section-element/" rel="bookmark" class="crp_title">The section element</a></li></ul></div><p><a href="http://html5doctor.com/outlines/" rel="bookmark">Document Outlines</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 12, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/outlines/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>HTML5 and Search Engine Optimisation (SEO)</title>
		<link>http://html5doctor.com/html5-seo-search-engine-optimisation/</link>
		<comments>http://html5doctor.com/html5-seo-search-engine-optimisation/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 14:30:58 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2821</guid>
		<description><![CDATA[<p>Through our handy Ask The Doctor service, we get a lot of e-mails asking us about <abbr>HTML</abbr>5's effect on Search Engine Optimisation (SEO). While we can't answer in great detail (Messrs Google, Yahoo, Bing, and their friends haven't sent us in-depth details of their algorithms), we've rounded up some useful facts from Google, the world's most dominant search engine.</p>]]></description>
			<content:encoded><![CDATA[<p>Through our handy <a href="http://html5doctor.com/ask-the-doctor/">Ask The Doctor</a> service, we get a lot of e-mails asking us about <abbr>HTML</abbr>5&#8242;s effect on Search Engine Optimisation (SEO). While we can&#8217;t answer in great detail (Messrs Google, Yahoo, Bing, and their friends haven&#8217;t sent us in-depth details of their algorithms), we&#8217;ve rounded up some useful facts from Google, the world&#8217;s most dominant search engine.</p>
<p>At the moment, <a href="http://googlewebmastercentral.blogspot.com/2010/03/microdata-support-for-rich-snippets.html">Google indexes HTML5 microdata</a> (<a href="/microdata/">more about microdata</a>) but does not reward you for using the new <abbr>HTML</abbr>5 structural elements, but neither does it penalise you:</p>
<blockquote cite="http://www.google.com/support/forum/p/Webmasters/thread?tid=2d4592cbb613e42c&amp;hl=en">
<p>As <abbr>HTML</abbr>5 gains in popularity and as we recognize specific markup elements that provide value to our indexing system, this is likely to change, but at the moment I would not assume that you would have an advantage by using <abbr>HTML</abbr>5 instead of older variants&hellip;.</p>
<p>Personally, I would recommend using <abbr>HTML</abbr>5 where you think that it already makes sense, perhaps reverting to <abbr>HTML</abbr>4 if you can determine that the browser won&#8217;t support the elements of <abbr>HTML</abbr>5 that you use properly. While this will not result in an advantage for your content in our search results, it generally wouldn&#8217;t be disadvantageous either.</p>
<footer><cite><a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=2d4592cbb613e42c&amp;hl=en">Google Webmaster Central: Does semantic html5 matter to google yet</a></cite></footer>
</blockquote>
<p><img src="http://html5doctor.com/wp-content/uploads/2011/01/search-engine-logos.jpg" alt="Logo's for Google, Yahoo and Bing" /></p>
<p>But they will take account of <abbr>HTML</abbr>5 once it becomes widespread, and they seem to be encouraging experimentation:</p>
<blockquote cite="http://www.google.com/support/forum/p/Webmasters/thread?tid=1d3850aec4e3dd96&amp;hl=en">
<p>Our general strategy is to wait to see how content is marked up on the web in practice and to adapt to that. If we find that more and more content uses <abbr>HTML</abbr>5 markup, that this markup can give us additional information, and that it doesn&#8217;t cause problems if webmasters incorrectly use it (which is always a problem in the beginning), then over time we&#8217;ll attempt to work that into our algorithms&hellip;.</p>
<p><abbr>HTML</abbr>5 is still very much a work in progress, so it&#8217;s great to see bleeding-edge sites making use of the new possibilities <img src='http://html5doctor.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<footer><cite><a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=1d3850aec4e3dd96&amp;hl=en">Google Webmaster Central: How well does Googlebot deal with non-standard tags?</a></cite></footer>
</blockquote>
<p>The Doctors&#8217; advice on <abbr>SEO</abbr> is to follow Google&#8217;s time-honoured guidelines: <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=100782">write valid, cross-browser, accessible <abbr>HTML</abbr></a>, <a href="http://www.youtube.com/watch?v=GIn5qJKU8VM">don&#8217;t misuse markup or &#8220;cloak&#8221; with <abbr>CSS</abbr></a>, make a site with a clear hierarchy and text links, and <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">write good content</a>:</p>
<blockquote cite="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">
<p>Create a useful, information-rich site, and write pages that clearly and accurately describe your content.</p>
<footer><cite><a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769#1">Google Webmaster Guidelines: Design and content guidelines</a></cite></footer>
</blockquote>
<p>Happy New Year. May your hat remain white.</p>
<h2>HTML5 microdata and schema.org</h2>
<p>Added October 2011:</p>
<p><a href="http://schema.org/">Schema.org</a> is a consortium of Bing, Google and Yahoo!. On its website it says</p>
<blockquote><p>[schema.org] provides a collection of schemas, i.e., html tags, that webmasters can use to markup their pages in ways recognized by major search providers. Search engines including Bing, Google and Yahoo! rely on this markup to improve the display of search results</p></blockquote>
<p>schema.org uses <a href="/microdata/">HTML5 microdata</a> with new elements like <a href="/the-time-element/"><code>&lt;time&gt;</code></a>. So, yes: in this special case (using these markup patterns) will ensure that this HTML5 will assist search engines to categorise your content (which is not the same as guaranteeing a higher ranking, of course).</p>
<h2>Multiple &lt;h1&gt;s on a page</h2>
<p>The new <a href="/outlines/">HTML5 outlining algorithm</a> allows multiple &lt;h1&gt;s in a page. We get lots of questions about whether developers will be penalised by Google which, according to myth, disallowed this.</p>
<p>I say &#8220;myth&#8221; because Google has always allowed multiple &lt;h1&gt;s on a page, provided that it&#8217;s organic rather than trying to game the system, as this video shows:</p>
<p><iframe width="400" height="233" src="http://www.youtube.com/embed/GIn5qJKU8VM?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>However, don&#8217;t go too crazy with the &lt;h1&gt;-only approach as it removes any hierarchy from your pages in browsers that don&#8217;t implement the outline algorithm and screenreaders that sit on top of them.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/the-nsfw-element/" rel="bookmark" class="crp_title">The nsfw element</a></li>
<li><a href="http://html5doctor.com/microdata/" rel="bookmark" class="crp_title">Extending HTML5 — Microdata</a></li>
<li><a href="http://html5doctor.com/time-and-data-element/" rel="bookmark" class="crp_title">Goodbye time, datetime, and pubdate. Hello data and value.</a></li>
<li><a href="http://html5doctor.com/outlines/" rel="bookmark" class="crp_title">Document Outlines</a></li>
<li><a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/" rel="bookmark" class="crp_title">YouTube and Vimeo support HTML5 Video</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/html5-seo-search-engine-optimisation/" rel="bookmark">HTML5 and Search Engine Optimisation (SEO)</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on January 11, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-seo-search-engine-optimisation/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz 5: URLs of commenters</title>
		<link>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/</link>
		<comments>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 14:30:57 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2741</guid>
		<description><![CDATA[<p>Here's nice and simple Simplquiz for Christmas. Imagine a new site, with  a news item in an <code>&#60;article&#62;</code> element. Within that are several user-submitted comments, each of which is in its own <code>&#60;article&#62;</code> element, as the spec recommends. Most commenting systems ask the commenter for his/ her URL, which is published in the header of the comment, usually as a link with the commenter's name as the linked text.</p>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s nice and simple Simplquiz for Christmas. Imagine a new site, with  a news item in an <code>&lt;article&gt;</code> element. Within that are several user-submitted comments, each of which is in its own <code>&lt;article&gt;</code> element, as the spec recommends. Most commenting systems ask the commenter for his/ her URL, which is published <del>in the header</del> <ins>at the beginning</ins> of the comment, usually as a link with the commenter&#8217;s name as the linked text.</p>

<p>How would you code the URL of a person leaving a comment (assuming they provided one)? Remember that there may be multiple comments on any one page. Also note that we’re not going to worry about what element wraps each comment this time. Choose from the five options below, and explain your rationale in the comments.</p>

<h2>A:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo/&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>B:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;cite&gt;&lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;&lt;/cite&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>C:</h2>
<pre><code>&lt;header&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;&lt;cite&gt;Tim 
Berners-Lee&lt;/cite&gt;&lt;/a&gt;
&lt;/header&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>D:</h2>
<pre><code>&lt;footer&gt;
Comment by &lt;address&gt;&lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;Tim 
Berners-Lee&lt;/a&gt;&lt;/address&gt;
&lt;/footer&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<h2>E:</h2>
<pre><code>&lt;h1&gt;
Comment by &lt;a href=&quot;http://www.myspace.com/timbo&quot;&gt;&lt;address&gt;Tim 
Berners-Lee&lt;/address&gt;&lt;/a&gt;
&lt;/h1&gt;
WTF! LOL! U SUCK! KTHXBAI!
</code></pre>

<p>Your answers below, please, and show your working out. We&#8217;ll close comments and give our opinions on Wednesday 22 December.</p>
<p>Rules: It is THE LAW that you read the preceding comments before adding your own. 
<strong>Note: please DON&#8217;T USE ANGLE BRACKETS in your comments. Escape them with &amp;lt; and &amp;gt; or just use [foo] – we&#8217;ll know what you mean.</strong>
</p><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</a></li><li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</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><li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li><li><a href="http://html5doctor.com/the-time-element/" rel="bookmark" class="crp_title">The time element (and microformats)</a></li></ul></div><p><a href="http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/" rel="bookmark">HTML5 Simplequiz 5: URLs of commenters</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on December 17, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz #4: figures, captions and alt text</title>
		<link>http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/</link>
		<comments>http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 14:15:49 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[WAI-ARIA]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2694</guid>
		<description><![CDATA[Simplequiz #4 asks about alt text on images that are captioned using HTML5 figure and figcaption. Steve Faulkner moderates this week.]]></description>
			<content:encoded><![CDATA[<p>A few years ago, <a href="http://www.simplebits.com/">Dan Cederholm</a> published a series of articles called <a href="http://simplebits.com/categories/simplequiz/">Simplequiz</a>. Dan posed some options for marking up a specified piece of content and invited readers to choose the one they felt was the best way to mark that up. The value was in the comments, where people defended their choices and debated the options (which means it is <em>the law</em> that you read the preceding comments before adding your own).</p>
<p>With Dan&#8217;s blessing, we&#8217;re running an occasional series of <abbr>HTML</abbr>5 Simplequizzes.</p>
<p><abbr>HTML</abbr>5 offers a way to associate a figure (which can be an image, a video, a graph, a table, a pull-quote) with a caption using the <a href="http://dev.w3.org/html5/spec/grouping-content.html#the-figure-element"><code>&lt;figure&gt;</code> element</a>. This is very common in print, but there has been no way to do this in <abbr>HTML</abbr>4, as there is no element that groups a figure and a caption (other than a semantically-empty <code>&lt;div&gt;</code>).</p>
<p>Our question this week is about alternate text for images that are captioned. I&#8217;ve gotten this wrong before (in print, embarrassingly), as have two highly-clueful friends of mine. The man who set us right will be your moderator and quizmaster this week, <a href="http://twitter.com/stevefaulkner">Steve Faulkner</a> of <a href="http://www.paciellogroup.com/">The Paciello Group</a>, possibly the most respected accessibility agency out there.</p>
<p>We have an image as a figure in a story simply about a dignitary opening a new branch of Mr Lidl&#8217;s marvelous emporium. The caption will be &#8220;Mayor of Casterbridge opens a new Lidl supermarket&#8221;.</p>
<p><img src="http://www.html5doctor.com/wp-content/uploads/2010/11/figure.jpg" alt="Generic picture of man cutting ribbon"></p>
<p>What&#8217;s the best markup for this? Show your working out.</p>
<h2>A:</h2>
<pre><code> &lt;figure&gt;
 &lt;img src=blah.png
  alt=&quot;A portly gent cuts a ribbon. He is with five small children, and is watched by two middle-aged woman, a very tall smiling man, and a small crowd&quot;&gt;
  &lt;figcaption&gt;
  Mayor of Casterbridge opens a new Lidl supermarket.
  &lt;/figcaption&gt;
 &lt;/figure&gt;</code></pre>
<h2>B:</h2>
<pre><code>&lt;figure role=img aria-labelledby=lidl&gt;
&lt;img src=blah.png alt=&quot;&quot;&gt;
 &lt;figcaption id=lidl&gt;
  Mayor of Casterbridge opens a new Lidl supermarket.
 &lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>
<h2>C:</h2>
<pre><code>&lt;figure&gt;
&lt;img src=blah.png&gt;
 &lt;figcaption&gt;
 Mayor of Casterbridge opens a new Lidl supermarket.
 &lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>
<h2>D:</h2>
<pre><code>&lt;figure&gt;
&lt;img src=blah.png alt=&quot;&quot;&gt;
 &lt;figcaption&gt;
 &lt;p&gt;Mayor of Casterbridge opens a new Lidl supermarket.&lt;/p&gt;
 &lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>
<h2>E:</h2>
<pre><code>&lt;figure&gt;
&lt;img src=blah.png alt=&quot;Mayor of Casterbridge opens a new Lidl supermarket.&quot;&gt;
 &lt;figcaption&gt;
  Mayor of Casterbridge opens a new Lidl supermarket.
&lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>
<p>Steve will wrap up the quiz next Thursday.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul class="related">
<li><a href="http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/" rel="bookmark" class="crp_title">HTML5 Simplequiz 6: Zeldman&#8217;s fat footer</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-1/" rel="bookmark" class="crp_title">HTML5 Simplequiz #1</a></li>
<li><a href="http://html5doctor.com/the-figure-figcaption-elements/" rel="bookmark" class="crp_title">The figure &#038; figcaption elements</a></li>
<li><a href="http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/" rel="bookmark" class="crp_title">HTML5 Simplequiz 5: URLs of commenters</a></li>
</ul>
</div>
<p><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark">HTML5 Simplequiz #4: figures, captions and alt text</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on November 5, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>HTML5 Simplequiz #2: citing people</title>
		<link>http://html5doctor.com/html5-simplequiz-2-citing-people/</link>
		<comments>http://html5doctor.com/html5-simplequiz-2-citing-people/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 13:24:27 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[Simplequiz]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2584</guid>
		<description><![CDATA[<p>A few years ago, Dan Cederholm published a series of articles called Simplequiz in which he posed some options for marking up a specified piece of content and invited readers to choose the one they felt was the best way to mark that up. The value was in the comments in which people said why they made that choice and debated the options (which means it is THE LAW that you read the preceeding comments before adding your own).</p>]]></description>
			<content:encoded><![CDATA[<p>A few years ago, <a href="http://www.simplebits.com/">Dan Cederholm</a> published a series of articles called <a href="http://simplebits.com/categories/simplequiz/">Simplequiz</a> in which he posed some options for marking up a specified piece of content and invited readers to choose the one they felt was the best way to mark that up. The value was in the comments in which people said why they made that choice and debated the options (which means it is <em>THE LAW</em> that you read the preceeding comments before adding your own).</p>

<p>With Dan&#8217;s blessing, we&#8217;re running an occasional series of HTML5 Simplequizzes. And here&#8217;s the second, suggested by a reader named Alohci.</p>

<p>It&#8217;s easy to cite works in HTML and default browser stylesheets obey the typographic convention of showing the citation in italics: </p>

<pre><code>&lt;p&gt;&lt;q&gt;There was a young man from Nantucket&lt;/q&gt; 
wrote John Keats in his &lt;cite&gt;Ode on a Grecian Urn&lt;/cite&gt;.&lt;/p&gt;</code></pre>

<p>(Although if you also link to an online copy of the work, do you put the link inside the cite element, or the cite element inside the <code>&lt;a&gt;</code>? Oops, that&#8217;s another discussion.)</p>

<p>But how do you mark up the <strong>author</strong> of the work cited &mdash; in this case, the text &#8220;John Keats&#8221;?</p>

<p>Choose from the answers below please. Make sure you show your working out.</p>

<h2>A:</h2>
<pre><code>&lt;b&gt;John Keats&lt;/b&gt;</code></pre>

<h2>B:</h2>
<pre><code>&lt;i&gt;John Keats&lt;/i&gt;</code></pre>

<h2>C:</h2>
<pre><code>&lt;cite&gt;John Keats&lt;/cite&gt;</code></pre>

<h2>D:</h2>
<pre><code>&lt;span style=&quot;font-style:italic&quot;&gt;John Keats&lt;/span&gt; </code></pre>
(eg, no semantic element available)

<h2>E:</h2>
<p>none of the above, and I shall leave a comment to tell you why each of the above is entirely preposterous</p>

<p>Your answers below, please, with your rationale. I&#8217;ll wade in on Thursday 14th October.</p>

<p><strong>Note: please DON&#8217;T USE ANGLE BRACKETS in your comments. Escape them with &amp;lt; and &amp;gt; or just use [foo] &#8211; we&#8217;ll know what you mean.</strong></p><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/html5-simplequiz-1/" rel="bookmark" class="crp_title">HTML5 Simplequiz #1</a></li><li><a href="http://html5doctor.com/html5-simplequiz-6-zeldmans-fat-footer/" rel="bookmark" class="crp_title">HTML5 Simplequiz 6: Zeldman&#8217;s fat footer</a></li><li><a href="http://html5doctor.com/html5-simplequiz-4-figures-captions-and-alt-text/" rel="bookmark" class="crp_title">HTML5 Simplequiz #4: figures, captions and alt text</a></li><li><a href="http://html5doctor.com/html5-simplequiz-5-urls-of-commenters/" rel="bookmark" class="crp_title">HTML5 Simplequiz 5: URLs of commenters</a></li><li><a href="http://html5doctor.com/your-questions-18/" rel="bookmark" class="crp_title">Your Questions 18</a></li></ul></div><p><a href="http://html5doctor.com/html5-simplequiz-2-citing-people/" rel="bookmark">HTML5 Simplequiz #2: citing people</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on October 8, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-simplequiz-2-citing-people/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<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[<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 class="related">
<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-11/" rel="bookmark" class="crp_title">Your Questions Answered #11</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-18/" rel="bookmark" class="crp_title">Your Questions 18</a></li>
</ul>
</div>
<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>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 class="related"><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/the-figure-figcaption-elements/" rel="bookmark" class="crp_title">The figure &#038; figcaption elements</a></li><li><a href="http://html5doctor.com/the-details-and-summary-elements/" rel="bookmark" class="crp_title">The details and summary elements</a></li></ul></div></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; [...]]]></description>
			<content:encoded><![CDATA[<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 class="related">
<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/your-questions-answered-11/" rel="bookmark" class="crp_title">Your Questions Answered #11</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/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>
</ul>
</div>
<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>120</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[<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 class="related">
<li><a href="http://html5doctor.com/avoiding-common-html5-mistakes/" rel="bookmark" class="crp_title">Avoiding common HTML5 mistakes</a></li>
<li><a href="http://html5doctor.com/your-questions-16/" rel="bookmark" class="crp_title">Your Questions #16</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/designing-a-blog-with-html5/" rel="bookmark" class="crp_title">Designing a blog with html5</a></li>
<li><a href="http://html5doctor.com/injecting-new-life-into-the-doctor/" rel="bookmark" class="crp_title">Injecting new life into the Doctor</a></li>
</ul>
</div>
<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>64</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[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 Dead on the telly. But you might not. You might want SHOUTY UPPERCASE tags, no [...]]]></description>
			<content:encoded><![CDATA[<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 class="related">
<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-17/" rel="bookmark" class="crp_title">Your Questions #17</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li>
</ul>
</div>
<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>71</slash:comments>
		</item>
	</channel>
</rss>

