<?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; HTML 5</title>
	<atom:link href="http://html5doctor.com/tag/html-5/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 #10</title>
		<link>http://html5doctor.com/your-questions-answered-10/</link>
		<comments>http://html5doctor.com/your-questions-answered-10/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 12:45:00 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[block links]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[headings]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[inline]]></category>
		<category><![CDATA[outline]]></category>
		<category><![CDATA[section]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1991</guid>
		<description><![CDATA[<p>The clinic is getting busy with more  <abbr>HTML</abbr>5 ailments. This week, we'll cover using sections within a footer, <code>&#60;canvas&#62;</code> vs. Flash security, why <abbr>HTML</abbr>5 elements are treated as inline, using offline with storage, and marking up block quotes.</p>]]></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-answered-10%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-10%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</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" /> The clinic is getting busy with more  <abbr>HTML</abbr>5 ailments. This week, we&#8217;ll cover using sections within a footer, <code>&lt;canvas&gt;</code> vs. Flash security, why <abbr>HTML</abbr>5 elements are treated as inline, using offline with storage, and marking up block quotes.</p>

<section>
<h2>Footer with sections</h2>

<p>Tommie asked:</p>
<blockquote><p>Hi, I&#8217;ll get to the point right away. I want to use, lets say 3 section elements inside a footer each floating left and inside each of this sections I have some standard information. Is this the right way to go, or should I put my section elements outside the footer and only put copyright text etc. inside the footer?</p>

<p>Thanks!</p></blockquote>

<p>You could use a <code>&lt;section&gt;</code> within <code>&lt;footer&gt;</code>. <del>but <code>&lt;footer&gt;</code> is a sectioning root anyway</del> <ins><code>&lt;footer&gt;</code> is flow content and can contain sectioning content.</ins> If you want them to appear in the outline within the footer, then it makes perfect sense to do as you suggest.</p>

<p>See more in Jack&#8217;s article on <a href="http://html5doctor.com/the-footer-element/">the <code>&lt;footer&gt;</code> element.</a> There are also some more examples in <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-footer-element">the spec</a>.</p>

<p>Cheers, Rich</p>
</section>

<section>
<h2><code>&lt;canvas&gt;</code> vs. Flash (security and copyright)</h2>
<p>John asked:</p>
<blockquote><p>I&#8217;m seeing lots of opinions that the <code>canvas</code> element might free us of the Adobe Flash monopoly, but what mechanisms can we use to protect our works when using straight HTML and JavaScript?</p>

<p>Right now I&#8217;m thinking about simple flash games, but I&#8217;m sure this is a concern for others wanting to use (free) <abbr>HTML</abbr> methods to perform functions now reserved more for flash.</p>

<p>Thanks for any input.</p></blockquote>

<p>I&#8217;m not sure of any security mechanisms that we can use to protect <code>&lt;canvas&gt;</code> content. It isn&#8217;t really any different than an image or any other type of resource. Having said that, decompilers can circumvent some of Flash&#8217;s security measures as well, so you may not be much worse off using <code>&lt;canvas&gt;</code>.</p>

<p>If we come across anything, we&#8217;ll be sure to let you know.</p>

<p>Cheers, Rich</p>
</section>

<section>
<h2><abbr>HTML</abbr>5 tags inline?</h2>
<p>Tami asked:</p>
<blockquote><p>So, I&#8217;ve been experimenting with the new <abbr>HTML</abbr>5 elements, and one frustration I have is understanding the native display of the new elements, and how it works within the document flow. So far, experimenting with them has shown them to be very unpredictable. At best, they&#8217;re kind of behaving like a bastard span. They seem to be behaving like inline elements but that seems like it is wrong. In some cases, setting to display: block gives the expected behavior, but on the footer tag, it&#8217;s not interacting with floated elements properly.</p>

<p>So, are these new elements inline or are browsers still just trying to catch up? I tried looking in in the <abbr>HTML</abbr>5 working draft spec, but so far I am not understanding the way its written (<abbr>HTML</abbr>4&#8217;s specs clearly spelled out whether an element was display or inline).</p></blockquote>

<p>Here&#8217;s an article from my personal blog that I wrote a while ago describing <a href="http://www.brucelawson.co.uk/2009/why-browsers-treat-html5-elements-as-inline/">why browsers treat <abbr>HTML</abbr>5 elements as inline</a>.</p>

<p>Thanks, Bruce.</p>
</section>

<section>
<h2>Offline + Storage</h2>
<blockquote><p>Dear Doctor, I&#8217;m trying to work out if <abbr>HTML</abbr>5 will be able to do the job that I want. I have a number of documents (<abbr>PDF</abbr>, <abbr>PPT</abbr>, etc.) that I want to share with people in my team. These documents may change from time to time. Also, the people may not always be connected online.</p>

<p>Would it be possible to &#8220;cache&#8221; documents in an offline database in the browser so that when they are not connected they can still view them but when they are, they get the latest versions (which also refresh the cache)?</p>

<p>That way I can do a fairly pretty interface for sorting these documents so that they can easily find them.</p>

<p>Thanks in advance for any help you can provide.</p></blockquote>

<p>You <em>can</em>, but I would strongly encourage you to think carefully about whether it&#8217;s worth it.</p>

<p>You can include these &#8220;assets&#8221; in the manifest, which will make the files available to the offline applications (note that this <strong>isn&#8217;t</strong> storage, just caching, which is what you&#8217;re after).</p>

<p>The problem is that when the visitor first hits the page with the manifest — which contains all the <abbr>PDF</abbr>s, <abbr>PPT</abbr>s, etc. — it will download <strong>all</strong> of these files. This is the bit that I&#8217;d encourage you to consider carefully. To compound that, I believe there&#8217;s a 5MB limit on the cache, so you might run into problems if you&#8217;re trying to cache more than that.</p>

<p>I&#8217;ve not covered offline cache on <abbr>HTML</abbr>5 Doctor yet (though it&#8217;s on the list), but I have described the process on my <a href="http://24ways.org/2009/breaking-out-the-edges-of-the-browser">24ways article</a>.</p> 

<p>If there are new versions of the cached files, you need to change the <em>contents</em> of the manifest — e.g., include a version number, which will trigger a download of <strong>all</strong> the assets again.  Not ideal, but that&#8217;s the current situation.</p>

<p>Hope that helps a bit, Remy</p>
</section>

<section>
<h2>Correct markup with blockquote</h2>
<p>Phil asked:</p>
<blockquote><p>Hi, in <abbr>HTML</abbr> 4.0 Strict and <abbr>XHTML</abbr> 1.0 Strict, text inside a <code>blockquote</code> element is required to be nested inside another block-level element, e.g. <code>p</code>.</p>

<p>In <abbr>HTML</abbr>5 that requirement seems to have been relaxed, as the following element validates successfully:</p>

<pre><code>&lt;blockquote&gt;This is a blockquote.&lt;/blockquote&gt;</code></pre>

<p>The HTML5 spec uses the <code>p</code> element in the usage examples, but does not mention whether it is required.</p>

<p>Can you please confirm if this requirement has now been deprecated?</p></blockquote>

<p>Great question. As I expected, this validates:</p>

<pre><code>&lt;!doctype html&gt;
&lt;meta charset=utf-8&gt;
&lt;title&gt;blockquote test&lt;/title&gt;
&lt;blockquote&gt;Tiger tiger burning bright&lt;/blockquote&gt;</code></pre>

<p>We double-checked with the <abbr>WHATWG</abbr> mailing list and confirmed that <code>&lt;blockquote&gt;</code> can contain &#8216;flow&#8217; content (i.e., text, paragraphs, etc.).</p>

<p>To summarise, it would be valid not to further mark up content within a <code>&lt;blockquote&gt;</code>, but authors are encouraged to use a <code>&lt;p&gt;</code> (or other more appropriate element).</p>

<p>Bruce</p>
</section>

<section>
<h2>Got a question for us?</h2>
<p>That wraps up this round of questions! If you&#8217;ve got a query about the <abbr>HTML</abbr>5 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>
</section><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</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-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</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-3/" rel="bookmark" class="crp_title">Your Questions Answered #3</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%2310%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-10%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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310&amp;bodytext=The%20clinic%20is%20getting%20busy%20with%20more%20%20HTML5%20ailments.%20This%20week%2C%20we%27ll%20cover%20using%20sections%20within%20a%20footer%2C%20%26lt%3Bcanvas%26gt%3B%20vs.%20Flash%20security%2C%20why%20HTML5%20elements%20are%20treated%20as%20inline%2C%20using%20offline%20with%20storage%2C%20and%20marking%20up%20block%20quotes." 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%2Fyour-questions-answered-10%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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310" 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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310&amp;notes=The%20clinic%20is%20getting%20busy%20with%20more%20%20HTML5%20ailments.%20This%20week%2C%20we%27ll%20cover%20using%20sections%20within%20a%20footer%2C%20%26lt%3Bcanvas%26gt%3B%20vs.%20Flash%20security%2C%20why%20HTML5%20elements%20are%20treated%20as%20inline%2C%20using%20offline%20with%20storage%2C%20and%20marking%20up%20block%20quotes." 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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310" 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%2Fyour-questions-answered-10%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=Your%20Questions%20Answered%20%2310&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-10%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%2Fyour-questions-answered-10%2F&amp;t=Your%20Questions%20Answered%20%2310" 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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310&amp;annotation=The%20clinic%20is%20getting%20busy%20with%20more%20%20HTML5%20ailments.%20This%20week%2C%20we%27ll%20cover%20using%20sections%20within%20a%20footer%2C%20%26lt%3Bcanvas%26gt%3B%20vs.%20Flash%20security%2C%20why%20HTML5%20elements%20are%20treated%20as%20inline%2C%20using%20offline%20with%20storage%2C%20and%20marking%20up%20block%20quotes." 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=Your%20Questions%20Answered%20%2310&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-10%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%2Fyour-questions-answered-10%2F&amp;t=Your%20Questions%20Answered%20%2310" 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%2Fyour-questions-answered-10%2F&amp;title=Your%20Questions%20Answered%20%2310&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=The%20clinic%20is%20getting%20busy%20with%20more%20%20HTML5%20ailments.%20This%20week%2C%20we%27ll%20cover%20using%20sections%20within%20a%20footer%2C%20%26lt%3Bcanvas%26gt%3B%20vs.%20Flash%20security%2C%20why%20HTML5%20elements%20are%20treated%20as%20inline%2C%20using%20offline%20with%20storage%2C%20and%20marking%20up%20block%20quotes." 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%2Fyour-questions-answered-10%2F&amp;h=Your%20Questions%20Answered%20%2310" 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%2Fyour-questions-answered-10%2F&amp;t=Your%20Questions%20Answered%20%2310&amp;s=The%20clinic%20is%20getting%20busy%20with%20more%20%20HTML5%20ailments.%20This%20week%2C%20we%27ll%20cover%20using%20sections%20within%20a%20footer%2C%20%26lt%3Bcanvas%26gt%3B%20vs.%20Flash%20security%2C%20why%20HTML5%20elements%20are%20treated%20as%20inline%2C%20using%20offline%20with%20storage%2C%20and%20marking%20up%20block%20quotes." 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/your-questions-answered-10/" rel="bookmark">Your Questions Answered #10</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 9, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-10/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The dl element</title>
		<link>http://html5doctor.com/the-dl-element/</link>
		<comments>http://html5doctor.com/the-dl-element/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:00:10 +0000</pubDate>
		<dc:creator>Mike Robinson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[dl]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=725</guid>
		<description><![CDATA[
			
				
			
		
The &#60;dl&#62; element existed in HTML 4, but it&#8217;s been repurposed in HTML5. Let the Doctor explain what&#8217;s changed and how it can be used.

It’s all in the description
In HTML 4, &#60;dl&#62; was considered a “definition list”, containing groups of terms and their definitions. The terms and definitions were a many-to-many relationship: one or more [...]]]></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%2Fthe-dl-element%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-dl-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>The <code>&lt;dl&gt;</code> element existed in <abbr title="Hypertext Mark-up Language">HTML</abbr> 4, but it&#8217;s been repurposed in <abbr>HTML</abbr>5. Let the Doctor explain what&#8217;s changed and how it can be used.</p>
<p><span id="more-725"></span></p>
<h2>It’s all in the description</h2>
<p>In <abbr>HTML</abbr> 4, <code>&lt;dl&gt;</code> was considered a “definition list”, containing groups of terms and their definitions. The terms and definitions were a many-to-many relationship: one or more terms to one or more definitions. The element was often misunderstood and therefore misused or not used at all in favour of more widely used and (perhaps) less semantic markup.</p>
<p>To address these issues, <code>&lt;dl&gt;</code>’s definition has been refined in <abbr>HTML</abbr>5 as a <a href="http://www.w3.org/TR/html-markup/dl.html#dl">description list</a>. From the spec:</p>
<blockquote><p>The dl element represents an association list consisting of zero or more name-value groups (a description list). Each group must consist of one or more names (dt elements) followed by one or more values (dd elements). Within a single dl element, there should not be more than one dt element for each name.</p>
</blockquote>
<p>It maintains the many-to-many relationship between names and values. These groupings use <a href="http://www.w3.org/TR/html-markup/dt.html#dt"><code>&lt;dt&gt;</code></a> to represent the term or name and <a href="http://www.w3.org/TR/html-markup/dd.html#dd"><code>&lt;dd&gt;</code></a> for the description. Also note the last line of the quote, stating that a name should not be used more than once within a single <code>&lt;dl&gt;</code>.</p>
<h2>Example Uses</h2>
<p>I&#8217;ve put together a couple of appropriate uses of <code>&lt;dl&gt;</code> to get your creative juices flowing.</p>
<h3>Glossary</h3>
<p><code>&lt;dl&gt;</code> can be used to mark-up a glossary of terms, although you must remember to use <code>&lt;dfn&gt;</code> to indicate that the word is defined here:</p>
<pre><code>&lt;article&gt;
  &lt;h1&gt;The article element&lt;/h1&gt;
  &lt;p&gt;An independent piece of content, one suitable for putting in an
    article element, is content that makes sense on it&rsquo;s own. This yardstick
    is up to your interpretation, but an easy smell test is would this make sense
    in an RSS feed? Of course weblog articles and static pages would make sense
    in a feed reader, and some sites have weblog comment feeds..&lt;/p&gt;
  ...
  &lt;aside&gt;
    &lt;h2&gt;Glossary&lt;/h2&gt;
    &lt;dl&gt;
      &lt;dt&gt;&lt;dfn&gt;RSS&lt;/dfn&gt;&lt;/dt&gt;
      &lt;dd&gt;An XML format for aggregating information from websites whose
        content is frequently updated.&lt;/dd&gt;
      &lt;dt&gt;&lt;dfn&gt;Weblog&lt;/dfn&gt;&lt;/dt&gt;
      &lt;dd&gt;Contraction of the term &quot;web log&quot;, a weblog is a
        website that is periodically updated, like a journal&lt;/dd&gt;
    &lt;/dl&gt;
  &lt;/aside&gt;
&lt;/aticle&gt;
</code></pre>
<p>The example content is from <a href="http://html5doctor.com/the-article-element/">our recent post on the article element</a>. In the example, I plucked out the terms &#8220;RSS&#8221; and &#8220;weblog&#8221; and defined them in a handy glossary. Since this information is supplementary to the article, the glossary has been placed in an <code>&lt;aside&gt;</code>.</p>
<h3>Metadata</h3>
<p><code>&lt;dl&gt;</code> is also appropriate for marking up content metadata, such as information about our article on <a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/">how to use <abbr>HTML</abbr>5 in your client work right now</a>.</p>
<pre><code>&lt;dl&gt;
  &lt;dt&gt;Authors:&lt;/dt&gt;
  &lt;dd&gt;Remy Sharp&lt;/dd&gt;
  &lt;dd&gt;Rich Clark&lt;/dd&gt;
  &lt;dt&gt;Editor:&lt;/dt&gt;
  &lt;dd&gt;Brandan Lennox&lt;/dd&gt;
  &lt;dt&gt;Category:&lt;/dt&gt;
  &lt;dd&gt;Comment&lt;/dd&gt;
&lt;/dl&gt;
</code></pre>
<p>Since Remy and Richard contributed to that article, they are both listed as authors, showing the pairing of multiple values (<code>&lt;dd&gt;</code>) to one key (<code>&lt;dt&gt;</code>).</p>
<h3>Multiple keys (<code>&lt;dt&gt;</code>) to a single value</h3>
<p>As mentioned above, a <code>&lt;dl&gt;</code> may map many keys (<code>&lt;dt&gt;</code>) to many values (<code>&lt;dd&gt;</code>). This means that one term might have multiple descriptions, or there may be multiple terms that mean the same thing. Related <code>&lt;dt&gt;</code>s should follow each other immediately before their descriptive <code>&lt;dd&gt;</code>.</p>
<pre><code>&lt;dl&gt;
  &lt;dt lang="en-GB"&gt;&lt;dfn&gt;colour&lt;/dfn&gt;&lt;/dt&gt;
  &lt;dt lang="en-US"&gt;&lt;dfn&gt;color&lt;/dfn&gt;&lt;/dt&gt;
  &lt;dd&gt;The visual result of light in their emission, transmission and/or reflection. This perception is determined by the hue, brightness and saturation of the light at a specific point. &lt;/dd&gt;
&lt;/dl&gt;
</code></pre>
<p>Here I have indicated that there are two different spellings of &#8220;colour&#8221; and grouped these terms to match them with the same description.</p>
<p>It is not appropriate, however, to use the same key multiple times within a single <code>&lt;dl&gt;</code>. You can&#8217;t define &#8220;car&#8221; as one thing at the start of a <code>&lt;dl&gt;</code> and then define it again at the end of that same <code>&lt;dl&gt;</code>. If you have multiple descriptions for a single term, you should list both <code>&lt;dd&gt;</code>s directly under the same <code>&lt;dt&gt;</code>.</p>
<pre><code>&lt;dl&gt;
  &lt;dt&gt;&lt;dfn&gt;Chips&lt;/dfn&gt;&lt;/dt&gt;
  &lt;dd&gt;Strips of potato usually deep fried in fat. Commonly referred to as "french fries".&lt;/dd&gt;
  &lt;dd&gt;A small fragment that has been broken off from a larger body (e.g. stone).&lt;/dd&gt;
&lt;/dl&gt;
</code></pre>
<h2>What it should not be used for</h2>
<p>Dialogue was a suggested use for <code>&lt;dl&gt;</code> in <abbr>HTML</abbr> 4, which was widely debated and often considered inappropriate. This application of the element is no longer recommended in <abbr>HTML</abbr>5, and the new definition of the element does indeed back this up. When marking up a conversation, you&#8217;re not describing the speaker, but rather stating what they said. With the demise of <a href="http://html5doctor.com/a-little-more-conversation-with-dialog/"><code>&lt;dialog&gt;</code></a>, conversations have no specific markup element. Instead, the specification makes recommendations of <a href="http://dev.w3.org/html5/spec/Overview.html#conversations">how to mark up conversations</a>.</p>
<h2>Summary</h2>
<p>The changes to <code>&lt;dl&gt;</code> are fairly minor, but the new definition should clear up confusion and enable developers to use it more appropriately. You can use this element to represent key-value pairs semantically and couple it with other elements like <code>&lt;details&gt;</code> and <code>&lt;aside&gt;</code> to give context to this information.</p>
<p>Where do you see yourself using <code>&lt;dl&gt;</code> in <abbr>HTML</abbr>5? Perhaps details about a downloadable file? Or are you going to give your more technical blog articles a glossary? Let us know in the comments!</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/the-article-element/" rel="bookmark" class="crp_title">The article element</a></li>
<li><a href="http://html5doctor.com/a-little-more-conversation-with-dialog/" rel="bookmark" class="crp_title">A little more conversation with dialog</a></li>
<li><a href="http://html5doctor.com/html5-doctor-glossary/" rel="bookmark" class="crp_title">HTML5 Doctor Glossary</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/understanding-aside/" rel="bookmark" class="crp_title">Understanding aside</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=The%20dl%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-dl-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%2Fthe-dl-element%2F&amp;title=The%20dl%20element&amp;bodytext=The%20%26lt%3Bdl%26gt%3B%20element%20existed%20in%20HTML%204%2C%20but%20it%27s%20been%20repurposed%20in%20HTML5.%20Let%20the%20Doctor%20explain%20what%27s%20changed%20and%20how%20it%20can%20be%20used.%0D%0A%0D%0A%0D%0A%0D%0AIt%E2%80%99s%20all%20in%20the%20description%0D%0A%0D%0AIn%20HTML%204%2C%20%26lt%3Bdl%26gt%3B%20was%20considered%20a%20%E2%80%9Cdefinition%20list%E2%80%9D%2C%20containin" 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%2Fthe-dl-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%2Fthe-dl-element%2F&amp;title=The%20dl%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%2Fthe-dl-element%2F&amp;title=The%20dl%20element&amp;notes=The%20%26lt%3Bdl%26gt%3B%20element%20existed%20in%20HTML%204%2C%20but%20it%27s%20been%20repurposed%20in%20HTML5.%20Let%20the%20Doctor%20explain%20what%27s%20changed%20and%20how%20it%20can%20be%20used.%0D%0A%0D%0A%0D%0A%0D%0AIt%E2%80%99s%20all%20in%20the%20description%0D%0A%0D%0AIn%20HTML%204%2C%20%26lt%3Bdl%26gt%3B%20was%20considered%20a%20%E2%80%9Cdefinition%20list%E2%80%9D%2C%20containin" 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%2Fthe-dl-element%2F&amp;title=The%20dl%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%2Fthe-dl-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=The%20dl%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-dl-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%2Fthe-dl-element%2F&amp;t=The%20dl%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%2Fthe-dl-element%2F&amp;title=The%20dl%20element&amp;annotation=The%20%26lt%3Bdl%26gt%3B%20element%20existed%20in%20HTML%204%2C%20but%20it%27s%20been%20repurposed%20in%20HTML5.%20Let%20the%20Doctor%20explain%20what%27s%20changed%20and%20how%20it%20can%20be%20used.%0D%0A%0D%0A%0D%0A%0D%0AIt%E2%80%99s%20all%20in%20the%20description%0D%0A%0D%0AIn%20HTML%204%2C%20%26lt%3Bdl%26gt%3B%20was%20considered%20a%20%E2%80%9Cdefinition%20list%E2%80%9D%2C%20containin" 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=The%20dl%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-dl-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%2Fthe-dl-element%2F&amp;t=The%20dl%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%2Fthe-dl-element%2F&amp;title=The%20dl%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=The%20%26lt%3Bdl%26gt%3B%20element%20existed%20in%20HTML%204%2C%20but%20it%27s%20been%20repurposed%20in%20HTML5.%20Let%20the%20Doctor%20explain%20what%27s%20changed%20and%20how%20it%20can%20be%20used.%0D%0A%0D%0A%0D%0A%0D%0AIt%E2%80%99s%20all%20in%20the%20description%0D%0A%0D%0AIn%20HTML%204%2C%20%26lt%3Bdl%26gt%3B%20was%20considered%20a%20%E2%80%9Cdefinition%20list%E2%80%9D%2C%20containin" 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%2Fthe-dl-element%2F&amp;h=The%20dl%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%2Fthe-dl-element%2F&amp;t=The%20dl%20element&amp;s=The%20%26lt%3Bdl%26gt%3B%20element%20existed%20in%20HTML%204%2C%20but%20it%27s%20been%20repurposed%20in%20HTML5.%20Let%20the%20Doctor%20explain%20what%27s%20changed%20and%20how%20it%20can%20be%20used.%0D%0A%0D%0A%0D%0A%0D%0AIt%E2%80%99s%20all%20in%20the%20description%0D%0A%0D%0AIn%20HTML%204%2C%20%26lt%3Bdl%26gt%3B%20was%20considered%20a%20%E2%80%9Cdefinition%20list%E2%80%9D%2C%20containin" 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/the-dl-element/" rel="bookmark">The dl element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 3, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-dl-element/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>HTML5 Custom Data Attributes (data-*)</title>
		<link>http://html5doctor.com/html5-custom-data-attributes/</link>
		<comments>http://html5doctor.com/html5-custom-data-attributes/#comments</comments>
		<pubDate>Thu, 27 May 2010 13:50:08 +0000</pubDate>
		<dc:creator>Chris Bewick</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1874</guid>
		<description><![CDATA[<p>Have you ever found yourself using element <code>class</code> names or <code>rel</code> attributes to store arbitrary snippets of metadata for the sole purpose of making your JavaScript simpler? If you have, then I have some exciting news for you! If you haven&#39;t and you&#39;re thinking, <q>Wow, that&#39;s a great idea!</q> I implore you to rid your mind of that thought immediately and continue reading.</p>]]></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%2Fhtml5-custom-data-attributes%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml5-custom-data-attributes%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>Have you ever found yourself using element <code>class</code> names or <code>rel</code> attributes to store arbitrary snippets of metadata for the sole purpose of making your JavaScript simpler? If you have, then I have some exciting news for you! If you haven&#39;t and you&#39;re thinking, <q>Wow, that&#39;s a great idea!</q> I implore you to rid your mind of that thought immediately and continue reading.</p>

<p>Thanks to <abbr>HTML</abbr>5, we now have the ability to embed custom data attributes on all <abbr>HTML</abbr> elements. These new custom data attributes consist of two parts:</p>

<dl> <dt>Attribute Name</dt> <dd>The data attribute name must be at least one character long and must be prefixed with &#39;<code>data-</code>&#39;. It should not contain any uppercase letters.</dd> <dt>Attribute Value</dt> <dd>The attribute value can be any string.</dd></dl>

<p>Using this syntax, we can add application data to our markup as shown below:</p>

<pre><code>&lt;ul id="vegetable-seeds"&gt;
  &lt;li data-spacing="10cm" data-sowing-time="March to June"&gt;Carrots&lt;/li&gt;
  &lt;li data-spacing="30cm" data-sowing-time="February to March"&gt;Celery&lt;/li&gt;
  &lt;li data-spacing="3cm" data-sowing-time="March to September"&gt;Radishes&lt;/li&gt;
&lt;/ul&gt; </code></pre>

<p>We can now use this stored data in our site&#8217;s JavaScript to create a richer, more engaging user experience. Imagine that when a user clicks on a vegetable a new layer opens up in the browser displaying the additional seed spacing and sowing instructions. Thanks to the <code>data-</code> attributes we&#8217;ve added to our <code>&lt;li&gt;</code> elements, we can now display this information instantly without having to worry about making any Ajax calls and without having to make any server-side database queries.</p>

<p>Prefixing the custom attributes with <code>data-</code> ensures that they will be completely ignored by the user agent. As far as the browser and indeed the website&#8217;s end user are concerned, this data does not exist.</p>

<p>The spec says (emphasis ours):</p>

<blockquote><p><strong>Custom data attributes are intended to store custom data private to the page or application, for which there are no more appropriate attributes or elements.</strong></p>

<p>These attributes are not intended for use by software that is independent of the site that uses the attributes.</p>

<p>Every HTML element may have any number of custom data attributes specified, with any value.</p>

<cite><a href="http://dev.w3.org/html5/spec/elements.html#embedding-custom-non-visible-data">W3C Specification</a></cite></blockquote>


<h2>How can I use data attributes?</h2>

<p>As custom data attributes are valid <abbr>HTML</abbr>5, they can be used in any browser that supports <abbr>HTML</abbr>5 doctypes. Thankfully, this is pretty much all of them. In addition to aiding backwards compatibility, this also ensures that custom data attributes will remain a scalable, cross-platform solution well into the future.</p>

<p>Now that we have a broad understanding of what data attributes are, let&#39;s take a look at how they can be used:</p>

<ul>
	<li>To store the initial height or opacity of an element which might be required in later JavaScript animation calculations</li>
	<li>To store parameters for a Flash movie that&#8217;s loaded via JavaScript</li>
	<li>To store custom web analytics tagging data as demonstrated by <a title="Google Analytics Tagging with HTML5 data-* Attributes" href="http://jasonkarns.com/blog/2010/03/10/google-analytics-tagging/">Jason Karns</a></li>
	<li>To store data about the health, ammo, or lives of an element in a JavaScript game</li>
	<li>To power accessible JavaScript <code>&lt;video&gt;</code> subtitles as demonstrated by <a title="Accessible HTML5 Video with JavaScripted captions" href="http://dev.opera.com/articles/view/accessible-html5-video-with-javascripted-captions/">Bruce Lawson</a></li>
</ul>



<h2>What shouldn&#8217;t I use data attributes for?</h2>

<p>Although flexible, data attributes aren&#8217;t an appropriate solution for all problems.</p>

<ul>
	<li>Data attributes should not be used if there is a existing attribute or element which is more appropriate for storing your data. For example, date/time data should probably be presented semantically in a time element instead rather than stored in custom data attributes.</li>
	<li>Custom data attributes are not intended to compete with microformats. It is clearly stated in the spec that the data is not intended to be publicly usable. External software should not interact with it. Marking up contact details or event details using custom data attributes would be wrong, unless of course it is only intended to be used by your own internal scripts.</li>
	<li>The presence/absence of a particular data attribute should not be used as a <abbr>CSS</abbr> hook for any styling. Doing so would suggest that the data you are storing is of immediate importance to the user and should be marked up in a more semantic and accessible manner.</li>
</ul>



<h2>Using <code>data-</code> attributes with JavaScript</h2>

<p>Now that we understand what custom <code>data-</code> attributes are and when we can use them, we should probably take a look at how we can interact with them using JavaScript.</p>

<p>If we wanted to retrieve or update these attributes using existing, native JavaScript, then we can do so using the <code>getAttribute</code> and <code>setAttribute</code> methods as shown below:</p>

<pre><code>&lt;div id='strawberry-plant' data-fruit='12'&gt;&lt;/div&gt;

&lt;script&gt;
// 'Getting' data-attributes using getAttribute
var plant = document.getElementById('strawberry-plant');
var fruitCount = plant.getAttribute('data-fruit'); // fruitCount = '12'

// 'Setting' data-attributes using setAttribute
plant.setAttribute('data-fruit','7'); // Pesky birds
&lt;/script&gt;</code></pre>

<p>This method will work in all modern browsers, but it is not how <code>data-</code> attributes are intended to be used. The second (new and improved) way to achieve the same thing is by accessing an element&#8217;s <code>dataset</code> property. This <code>dataset</code> property — part of the new <abbr>HTML</abbr>5 JavaScript <abbr>API</abbr>s — will return a <code>DOMStringMap</code> object of all the selected element&#39;s <code>data-</code> attributes. When using this approach, rather than using the full attribute name, you can ditch the <code>data-</code> prefix and refer to the custom data directly using the name you have assigned to it. Data attribute names which contain hyphens will be stripped of their hyphens and converted to <a href="http://en.wikipedia.org/wiki/CamelCase">CamelCase</a>.</p>

<pre><code>&lt;div id='sunflower' data-leaves='47' data-plant-height='2.4m'&gt;&lt;/div&gt;

&lt;script&gt;
// 'Getting' data-attributes using dataset 
var plant = document.getElementById('sunflower');
var leaves = plant.dataset.leaves; // leaves = 47;

// 'Setting' data-attributes using dataset
var tallness = plant.dataset.plantHeight; // 'plant-height' -&gt; 'plantHeight'
plant.dataset.plantHeight = '3.6m';  // Cracking fertiliser
&lt;/script&gt;</code></pre>

<p>If, at some point in your script, a specific <code>data-</code> attribute becomes redundant and is no longer needed, it is also possible to completely remove that attribute from the DOM element by setting it to a value of <code>null</code>.</p>

<pre><code>plant.dataset.leaves = null; // Caterpillars attack!</code></pre>

<p>Unfortunately, the new <code>dataset</code> property has not yet been implemented in any browser, so in the meantime it&#8217;s best to use <code>getAttribute</code> and <code>setAttribute</code> as demonstrated earlier.</p>

<p>While developing your application, you may find it useful to be able to select elements based on the presence of — or indeed the specific values of — their custom <code>data-</code> attributes. This can be achieved quickly and easily using <code>querySelectorAll</code> as shown below:</p>

<pre><code>// Select all elements with a 'data-flowering' attribute
document.querySelectorAll('[data-flowering]');

// Select all elements with red leaves
document.querySelectorAll('[data-foliage-colour="red"]');</code></pre>



<h2>A word of warning</h2>

<p>As data attributes become more widely used, the potential for clashes in naming conventions becomes much greater. If you use an unimaginative attribute name such as <code>data-height</code>, then it is likely you will eventually come across a library or plugin that uses the same attribute name. Multiple scripts getting and setting a common <code>data-</code> attribute will probably cause chaos. In order to avoid this, I encourage people to choose a standard string (perhaps the site/plugin name) to prefix all their <code>data-</code> attributes — e.g. <code>data-html5doctor-height</code> or <code>data-my-plugin-height</code>.</p>



<h2>Summary</h2>

<p>Custom <code>data-</code> attributes are a great way to simplify the storage of application data in your web pages. Although you can&#8217;t utilise the new JavaScript <abbr>API</abbr>s just yet, you can enjoy great success using <code>getAttribute</code> and <code>setAttribute</code> safe in the knowledge that they will work in all major browsers.</p>



<h2>Homework</h2>

<p>If you&#8217;re super keen to have a play with the new <code>dataset</code> property but disappointed that it hasn&#8217;t been implemented, fear not!, for there is a light at the end of the tunnel. You might be interested in looking at <a href="/author/remys/">Dr Remy&#8217;s</a>  <a title="Code to enable dataset functionality in some browsers" href="http://gist.github.com/362081">experimental code</a>, which partially enables the <code>dataset</code> functionality in some browsers by editing the <code>Element.prototype</code>.</p>

<p>The code supports the retrieval of <code>data-</code> attributes in the latest versions of Firefox, Safari, Opera, and Chrome, but sadly will not work in any version of <abbr>IE</abbr> (since <abbr>IE</abbr> does not expose the Element object). This code also partially supports the setting of data attributes, but it will only store the new attribute values within the JavaScript and will not update the <abbr>DOM</abbr> element as a full, native implementation of the <code>dataset</code> property would. Although this code is mainly a proof of concept, it may be useful for mobile application or intranet development in closed environments where cross-browser (<abbr>IE</abbr>) compatibility is not an issue.</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/native-drag-and-drop/" rel="bookmark" class="crp_title">Native Drag and Drop</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/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li><li><a href="http://html5doctor.com/the-video-element/" rel="bookmark" class="crp_title">The video element</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29%20-%20http%3A%2F%2Fhtml5doctor.com%2Fhtml5-custom-data-attributes%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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;bodytext=Have%20you%20ever%20found%20yourself%20using%20element%20class%20names%20or%20rel%20attributes%20to%20store%20arbitrary%20snippets%20of%20metadata%20for%20the%20sole%20purpose%20of%20making%20your%20JavaScript%20simpler%3F%20If%20you%20have%2C%20then%20I%20have%20some%20exciting%20news%20for%20you%21%20If%20you%20haven%26%2339%3Bt%20and%20you%26%2339%3Bre%20thinking%2C%20Wow%2C%20that%26%2339%3Bs%20a%20great%20idea%21%20I%20implore%20you%20to%20rid%20your%20mind%20of%20that%20thought%20immediately%20and%20continue%20reading." 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%2Fhtml5-custom-data-attributes%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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29" 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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;notes=Have%20you%20ever%20found%20yourself%20using%20element%20class%20names%20or%20rel%20attributes%20to%20store%20arbitrary%20snippets%20of%20metadata%20for%20the%20sole%20purpose%20of%20making%20your%20JavaScript%20simpler%3F%20If%20you%20have%2C%20then%20I%20have%20some%20exciting%20news%20for%20you%21%20If%20you%20haven%26%2339%3Bt%20and%20you%26%2339%3Bre%20thinking%2C%20Wow%2C%20that%26%2339%3Bs%20a%20great%20idea%21%20I%20implore%20you%20to%20rid%20your%20mind%20of%20that%20thought%20immediately%20and%20continue%20reading." 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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29" 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%2Fhtml5-custom-data-attributes%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=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml5-custom-data-attributes%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%2Fhtml5-custom-data-attributes%2F&amp;t=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29" 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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;annotation=Have%20you%20ever%20found%20yourself%20using%20element%20class%20names%20or%20rel%20attributes%20to%20store%20arbitrary%20snippets%20of%20metadata%20for%20the%20sole%20purpose%20of%20making%20your%20JavaScript%20simpler%3F%20If%20you%20have%2C%20then%20I%20have%20some%20exciting%20news%20for%20you%21%20If%20you%20haven%26%2339%3Bt%20and%20you%26%2339%3Bre%20thinking%2C%20Wow%2C%20that%26%2339%3Bs%20a%20great%20idea%21%20I%20implore%20you%20to%20rid%20your%20mind%20of%20that%20thought%20immediately%20and%20continue%20reading." 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=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml5-custom-data-attributes%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%2Fhtml5-custom-data-attributes%2F&amp;t=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29" 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%2Fhtml5-custom-data-attributes%2F&amp;title=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Have%20you%20ever%20found%20yourself%20using%20element%20class%20names%20or%20rel%20attributes%20to%20store%20arbitrary%20snippets%20of%20metadata%20for%20the%20sole%20purpose%20of%20making%20your%20JavaScript%20simpler%3F%20If%20you%20have%2C%20then%20I%20have%20some%20exciting%20news%20for%20you%21%20If%20you%20haven%26%2339%3Bt%20and%20you%26%2339%3Bre%20thinking%2C%20Wow%2C%20that%26%2339%3Bs%20a%20great%20idea%21%20I%20implore%20you%20to%20rid%20your%20mind%20of%20that%20thought%20immediately%20and%20continue%20reading." 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%2Fhtml5-custom-data-attributes%2F&amp;h=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29" 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%2Fhtml5-custom-data-attributes%2F&amp;t=HTML5%20Custom%20Data%20Attributes%20%28data-%2A%29&amp;s=Have%20you%20ever%20found%20yourself%20using%20element%20class%20names%20or%20rel%20attributes%20to%20store%20arbitrary%20snippets%20of%20metadata%20for%20the%20sole%20purpose%20of%20making%20your%20JavaScript%20simpler%3F%20If%20you%20have%2C%20then%20I%20have%20some%20exciting%20news%20for%20you%21%20If%20you%20haven%26%2339%3Bt%20and%20you%26%2339%3Bre%20thinking%2C%20Wow%2C%20that%26%2339%3Bs%20a%20great%20idea%21%20I%20implore%20you%20to%20rid%20your%20mind%20of%20that%20thought%20immediately%20and%20continue%20reading." 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/html5-custom-data-attributes/" rel="bookmark">HTML5 Custom Data Attributes (data-*)</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 27, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html5-custom-data-attributes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The article element</title>
		<link>http://html5doctor.com/the-article-element/</link>
		<comments>http://html5doctor.com/the-article-element/#comments</comments>
		<pubDate>Tue, 18 May 2010 14:00:27 +0000</pubDate>
		<dc:creator>Tom Leadbetter</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[pubdate]]></category>
		<category><![CDATA[section]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1364</guid>
		<description><![CDATA[<p>We’ve discussed a lot of new elements here at HTML5Doctor, but the <code>article</code> element has somehow escaped the microscope… until now! <code>article</code> is one of the new sectioning elements. It is often confused with <code>section</code> and <code>div</code> but don't worry we'll explain the difference between them.</p>]]></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%2Fthe-article-element%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>We’ve discussed a lot of new elements here at HTML5Doctor, but the <code>article</code> element has somehow escaped the microscope… until now! <code>article</code> is one of the new sectioning elements. It is often confused with <code>section</code> and <code>div</code> but don&#8217;t worry we&#8217;ll explain the difference between them.</p>

<section>
<h2>What the spec says</h2>
<p>Thankfully, <a href="http://www.w3.org/TR/html5/semantics.html#the-article-element">the spec is short and sweet</a>:</p>

<blockquote><p>The <code>article</code> element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.</p><footer><cite><a href="http://www.w3.org/TR/html5/semantics.html#the-article-element">W3C Specification</a></cite></footer></blockquote>

<p>In addition to it’s content, an <code>&lt;article&gt;</code> element typically has a heading (often in a header element), and sometimes a footer. The easiest way to conceptualise <code>&lt;article&gt;</code> is to think of it’s use in a weblog, as mentioned in the spec’s examples “a blog entry” and “user-submitted comments.” Here at <abbr>HTML</abbr>5 Doctor, we wrap each weblog entry inside an <code>&lt;article&gt;</code> element. We also use <code>&lt;article&gt;</code> on ‘static’ content pages, like the About and Contact pages, as <code>&lt;article&gt;</code> can be used for “any other independent item of content.” The tricky part is, what exactly is an <em>independent item of content</em>?</p>
</section>

<section>
<h2>The smell test for going independent</h2>
<p>An <em>independent</em> piece of content, one suitable for putting in an <code>&lt;article&gt;</code> element, is content that <em>makes sense on it’s own</em>. This yardstick is up to your interpretation, but an easy smell test is <em>would this make sense in an RSS feed?</em> Of course weblog articles and static pages would make sense in a feed reader, and some sites have weblog comment feeds. On the other hand, a feed with each paragraph of this article as a separate post wouldn’t be very useful. The key point here is that the content has to make sense <em>independent of its context</em>, i.e. when all the surrounding content is stripped away.</p>
</section>

<section>
<h2>Examples of <code>&lt;article&gt;</code> in use</h2>
<section>
<h3>A bare-bones <code>&lt;article&gt;</code></h3>

<p>We only have a title and some content, but it’s enough to make sense on it’s own (assume there’s <a href="http://en.wikipedia.org/wiki/Apples" title="Apple - Wikipedia, the free encyclopedia">a lot more content about apples</a> <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<pre><code>&lt;article&gt;
	&lt;h1&gt;Apple&lt;/h1&gt;
	&lt;p&gt;The &lt;b&gt;apple&lt;/b&gt; is the pomaceous fruit of the apple tree...&lt;/p&gt;
	...
&lt;/article&gt;
</code></pre>
</section>

<section>
<h3>A weblog-style <code>&lt;article&gt;</code></h3>
<p>A published date leads us to add a <code>&lt;header&gt;</code>, and there’s also content that would be suitable in a <code>&lt;footer&gt;</code> elements.</p>

<pre><code>&lt;article&gt;
  &lt;header&gt;
    &lt;h1&gt;Apple&lt;/h1&gt;
    &lt;p&gt;Published: &lt;time pubdate="pubdate"&gt;2009-10-09&lt;/time&gt;&lt;/p&gt;
  &lt;/header&gt;
  &lt;p&gt;The &lt;b&gt;apple&lt;/b&gt; is the pomaceous fruit of the apple tree...&lt;/p&gt;
  ...
  &lt;footer&gt;
    &lt;p&gt;&lt;small&gt;Creative Commons Attribution-ShareAlike License&lt;/small&gt;&lt;/p&gt;
  &lt;/footer&gt;
&lt;/article&gt;</code></pre>
</section>

<section>
<h3>An <code>&lt;article&gt;</code> with comments as nested <code>&lt;article&gt;</code>s</h3>
<p>This example shows a weblog entry with comments. Each comment can be marked up as an <code>&lt;article&gt;</code> within the containing <code>&lt;article&gt;</code>.</p>  

<pre><code>&lt;article&gt;
  &lt;header&gt;
    &lt;h1&gt;Apple&lt;/h1&gt;
    &lt;p&gt;Published: &lt;time pubdate datetime="2009-10-09"&gt;9th October, 2009&lt;/time&gt;&lt;/p&gt;
  &lt;/header&gt;
  &lt;p&gt;The &lt;b&gt;apple&lt;/b&gt; is the pomaceous fruit of the apple tree...&lt;/p&gt;
  ...
  
  &lt;section&gt;
    &lt;h2&gt;Comments&lt;/h2&gt;
    &lt;article&gt;
      &lt;header&gt;
      &lt;h3&gt;Posted by: Apple Lover&lt;/h3&gt;
      &lt;p&gt;&lt;time pubdate datetime="2009-10-10T19:10-08:00"&gt;~1 hour ago&lt;/time&gt;&lt;/p&gt;
    &lt;/header&gt;
    &lt;p&gt;I love apples, my favourite kind are Granny Smiths&lt;/p&gt;
    &lt;/article&gt;
    
    &lt;article&gt;
      &lt;header&gt;
        &lt;h3&gt;Posted by: Oranges are king&lt;/h3&gt;
        &lt;p&gt;&lt;time pubdate datetime="2009-10-10T19:15-08:00"&gt;~1 hour ago&lt;/time&gt;&lt;/p&gt;
      &lt;/header&gt;
      &lt;p&gt;Urgh, apples!? you should write about ORANGES instead!!1!&lt;/p&gt;
    &lt;/article&gt;
  &lt;/section&gt;
&lt;/article&gt;</code></pre>
</section>

<section>
<h3>An <code>&lt;article&gt;</code> with <code>&lt;section&gt;</code>s</h3>
<p>You can use <a href="http://html5doctor.com/the-section-element/">the <code>&lt;section&gt;</code> element</a> to split the article into logical groups of content with headings:</p>

<pre><code>&lt;article&gt;
  &lt;h1&gt;Apple varieties&lt;/h1&gt;
  &lt;p&gt;The apple is the pomaceous fruit of the apple tree...&lt;/p&gt;

  &lt;section&gt;
    &lt;h2&gt;Red Delicious&lt;/h2&gt;
    &lt;p&gt;These bright red apples are the most common found in many supermarkets...&lt;/p&gt;
  &lt;/section&gt;

  &lt;section&gt;
    &lt;h2&gt;Granny Smith&lt;/h2&gt;
    &lt;p&gt;These juicy, green apples make a great filling for apple pies...&lt;/p&gt;
  &lt;/section&gt;
    
&lt;/article&gt;</code></pre>
</section>

<section>
<h3>A <code>&lt;section&gt;</code> containing <code>&lt;article&gt;</code>s</h3>
<p>Where appropriate a <code>&lt;section&gt;</code> element can contain <code>&lt;article&gt;</code> elements. We already saw this in the comment section example above, and other common examples are the homepage or category pages of a weblog:</p>

<pre><code>&lt;section&gt;
  &lt;h1&gt;Articles on: Fruit&lt;/h1&gt;

  &lt;article&gt;
    &lt;h2&gt;Apple&lt;/h2&gt;
    &lt;p&gt;The apple is the pomaceous fruit of the apple tree...&lt;/p&gt;
  &lt;/article&gt;

  &lt;article&gt;
    &lt;h2&gt;Orange&lt;/h2&gt;
    &lt;p&gt;The orange is a hybrid of ancient cultivated origin, possibly between pomelo and tangerine...&lt;/p&gt;
  &lt;/article&gt;

  &lt;article&gt;
    &lt;h2&gt;Banana&lt;/h2&gt;
    &lt;p&gt;Bananas come in a variety of sizes and colors when ripe, including yellow, purple, and red...&lt;/p&gt;
  &lt;/article&gt;
    
&lt;/section&gt;</code></pre>
</section>

<section>
<h3>Using <code>&lt;article&gt;</code> for a widget</h3>
<p>The specification also mentions that an interactive widget can also be an <code>&lt;article&gt;</code>. The example below shows how the markup might look for an embedded widget from somewhere like <a href="http://www.widgetbox.com/">Widgetbox</a>.</p>

<pre><code>&lt;article&gt;
  &lt;h1&gt;My Fruit Spinner&lt;/h1&gt;
  &lt;object&gt;
    &lt;param name="allowFullScreen" value="true"&gt;
    &lt;embed src="#" width="600" height="395"&gt;&lt;/embed&gt;
  &lt;/object&gt;
&lt;/article&gt;</code></pre>
</section>
</section>

<section>
<h2>The <code>pubdate</code> attribute</h2>
<p>You may have noticed the <code>pubdate</code> attribute in these examples. <code>pubdate</code> is an optional <em>boolean attribute</em> that may be added to one <a href="http://html5doctor.com/the-time-element"><code>time</code> element</a> within the <code>&lt;article&gt;</code>. If present it indicates that the <code>&lt;time&gt;</code> element is the date the <code>&lt;article&gt;</code> was published. It can be written in several ways, the most popular being:</p>

<pre><code>pubdate
pubdate="pubdate"</code></pre>

<p>You could think of these as HTML and XHTML-style — the end result is the same so use the style you like. Note that <code>pubdate</code> applies only to the parent <code>&lt;article&gt;</code> element, or to the document as a whole.</p>
</section>

<section>
<h2>The difference between <code>&lt;article&gt;</code> and <code>&lt;section&gt;</code></h2>
<p>There&#8217;s been <a href="http://adactio.com/journal/1654/">a lot of confusion</a> over the difference (or perceived lack of a difference) between the <code>&lt;article&gt;</code> and <code>&lt;section&gt;</code> elements in <abbr>HTML</abbr>5. The <code>&lt;article&gt;</code> element is a specialised kind of <code>&lt;section&gt;</code>; it has a more specific semantic meaning than <code>&lt;section&gt;</code> in that it is <strong>an independent, self-contained</strong> block of related content. We <em>could</em> use <code>&lt;section&gt;</code>, but using <code>&lt;article&gt;</code> gives more semantic meaning to the content.</p>

<p>By contrast <code>&lt;section&gt;</code> is only a block of <em>related</em> content, and <code>&lt;div&gt;</code> is only a block of content. Also as mentioned above the <code>pubdate</code> attribute doesn’t apply to <code>&lt;section&gt;</code>. To decide which of these three elements is appropriate, choose the first suitable option:</p>

<ol>
<li>Would the content would make sense on it’s own in a feed reader? If so use <code>&lt;article&gt;</code></li>
<li>Is the content related? If so use <code>&lt;section&gt;</code></li>
<li>Finally if there’s no semantic relationship use <code>&lt;div&gt;</code></li>
</ol>

<p><a href="http://html5doctor.com/author/brucel">Dr Bruce</a> has written <a href="http://www.brucelawson.co.uk/2010/html5-articles-and-sections-whats-the-difference/">HTML5 <code>&lt;article&gt;</code>s and <code>&lt;section&gt;</code>s, what’s the difference?</a>, so we recommend reading that if you are still fuzzy on when to use <code>&lt;article&gt;</code>.</p>
</section>

<section>
<h2>Summary</h2>
<p>Hopefully this post has given you some insight into the correct use of the <code>&lt;article&gt;</code> element. Do you have any other examples that you can share for using <code>&lt;article&gt;</code> in your <abbr>HTML</abbr>5 markup?</p>

<p>I&#8217;m also keen to hear your thoughts on the confusion between the <code>&lt;article&gt;</code> and <code>&lt;section&gt;</code> elements. Do you think the distinction between the two is clear?</p>
</section><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/the-dl-element/" rel="bookmark" class="crp_title">The dl element</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/your-questions-answered-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</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/your-questions-answered-6/" rel="bookmark" class="crp_title">Your Questions Answered #6</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20article%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%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%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;bodytext=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." 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%2Fthe-article-element%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%2Fthe-article-element%2F&amp;title=The%20article%20element" 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%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;notes=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." 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%2Fthe-article-element%2F&amp;title=The%20article%20element" 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%2Fthe-article-element%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=The%20article%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%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%2Fthe-article-element%2F&amp;t=The%20article%20element" 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%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;annotation=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." 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=The%20article%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%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%2Fthe-article-element%2F&amp;t=The%20article%20element" 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%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." 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%2Fthe-article-element%2F&amp;h=The%20article%20element" 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%2Fthe-article-element%2F&amp;t=The%20article%20element&amp;s=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." 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/the-article-element/" rel="bookmark">The article element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 18, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-article-element/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered 9</title>
		<link>http://html5doctor.com/your-questions-answered-9/</link>
		<comments>http://html5doctor.com/your-questions-answered-9/#comments</comments>
		<pubDate>Fri, 14 May 2010 14:15:57 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[figcaption]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[offline]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1779</guid>
		<description><![CDATA[<p>The Doctor is in with another round of patient questions about <abbr>HTML</abbr>5. This week, we'll cover offline viewing on requests, the drag-and-drop <abbr>API</abbr>, using <code>href</code> on any element, the <code>&#60;figure&#62;</code> element, and headings.</p>]]></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-answered-9%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-9%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" /> The Doctor is in with another round of patient questions about <abbr>HTML</abbr>5. This week, we&#8217;ll cover offline viewing on requests, the drag-and-drop <abbr>API</abbr>, using <code>href</code> on any element, the <code>&lt;figure&gt;</code> element, and headings.</p>
<h2>Offline viewing on requests</h2>
<p>Johan asked:</p>
<blockquote><p>It is possible to let Firefox 3.5/3.6 save a page for offline viewing with the manifest file?<br />
In that case Firefox asks for permission to save the site the same second you arrive – not very user-friendly.</p>
<p>Is it possible to send the save-it-locally request via Javascript on a click?</p>
<p>Basically I want a link/button which will fire the request – and not on document load.</p>
</blockquote>
<p>While it isn&#8217;t possible to make Firefox 3.5/3.6 save a page for offline viewing with the manifest file, there is <em>a</em> way to do this. It all depends on how you write the &#8220;save-it-locally request&#8221; code. You have two options:</p>
<ol>
<li>If you want to store an arbitrary document that is not explicitly listed in your manifest, you could run an Ajax request for that document and store its contents in <code>localStorage</code>. When you want to view that document, load it from <code>localStorage</code> and overlay it on the existing page.</li>
<li>Dynamically manage a manifest file for individual users, so that if a user requests a new file that isn&#8217;t in their manifest, register this on the server side and add it to the manifest — which is bespoke to this specific user — on the fly.</li>
</ol>
<p>I&#8217;m not sure what you&#8217;re seeing with regards to the permissions error. When I test the manifest (offline **cache**), it doesn&#8217;t ask twice.</p>
<p><small>Note: you asked about Firefox 3.5 — the offline manifest doesn&#8217;t work properly at all in this version.</small></p>
<p>Thanks, Remy</p>
<h2>Question about dragging</h2>
<p>Marc asked:</p>
<blockquote><p>Evening,</p>
<p>I&#8217;m trying to get my head around the drag and drop (DnD) possibilities of <abbr>HTML</abbr>5. I have a &#8220;simple&#8221; task: Read the content of a <abbr>XML</abbr> file, using JavaScript, and do some manipulations of he <abbr>XML</abbr>. Without the use of server side scripts.</p>
<p>I tried my way with Google, but apart from people complaining about the DnD specs, I wasn&#8217;t able to find much insightful informations.</p>
<p>Can you point me toward resources to understand the DnD possibilities of <abbr>HTML</abbr>5?</p>
<p>Thank you Doctor, a French canadian <abbr>HTML</abbr>5 fan <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</blockquote>
<p>Absolutely! There&#8217;s actually an <abbr>HTML</abbr>5 Doctor article covering <a href="http://html5doctor.com/native-drag-and-drop/">native drag-and-drop</a>. It also includes links for further reading and related posts (such as accessibility experiments).</p>
<p>I hope that helps.</p>
<p>Cheers, Remy</p>
<h2>About the <code>href</code> on any element</h2>
<p>Luan asked:</p>
<blockquote><p>I&#8217;ve heard a long ago that href would work in any tag, such as a <code>&lt;p href="..."&gt;</code> or a <code>h1</code>, even a <code>div</code> and others&#8230; but I don&#8217;t see anything about this in the last days. Do you know if this is going to work?</p>
</blockquote>
<p>That was in <abbr>XHTML</abbr>2 (on which the <abbr>W3C</abbr> have now stopped work).</p>
<p>The <abbr>HTML</abbr>5 equivalent is to wrap an <code>&lt;a href="..."&gt;</code> around the other tags. It&#8217;s called block-level linking, and we&#8217;ve <a href="http://html5doctor.com/block-level-links-in-html-5/">written an article</a> about it.</p>
<p>Cheers, Bruce</p>
<h2><abbr>W3C</abbr> Validator for the <code>&lt;figure&gt;</code> element</h2>
<p>Fjpoblam asked:</p>
<blockquote><p>I have a (prospective) structure containing 8 figures: each an image with a caption. My goal is an image gallery, each image clickable toward an individual htm file containing a slide show. (In html4 I structured each &#8220;figure&#8221; as a div: figure seemed ideal for the task.)</p>
<p>Problem is, I tried to follow the *validator* hint with a dd for the image and a dt for the caption (each surrounded by an a). Upon doing so, the validator pops up an error. When I try a straight image with a legend, it is also rejected for want of a dd and an optional dt.</p>
<p>What gives? Do you have a hint? Or better, simply, point me doofus to the correct doc so&#8217;s you&#8217;ll &#8220;teach a man to fish&#8221;.</p>
</blockquote>
<p>I&#8217;m not sure if the validator is up to date or not, but you shouldn&#8217;t be using <code>&lt;dd&gt;</code>/<code>&lt;dt&gt;</code> in <code>&lt;figure&gt;</code> anymore. Please use <code>&lt;figcaption&gt;</code>.</p>
<p>See our article on <a href="http://html5doctor.com/the-figure-figcaption-elements/">the <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> elements</a> for more.</p>
<p>Also see our <a href="http://html5doctor.com/glossary/">glossary</a> for more examples.</p>
<p>Cheers, Rich</p>
<h2>Headings</h2>
<p>Thomas asked:</p>
<blockquote><p>Dear Doctors,</p>
<p>you covered the new <code>header</code> tag in an article. The <code>header</code> tag should contain a heading element, like h1-6. So far so good, but how do I structure my headings further on. E.g. I&#8217;ve got this:</p>
<pre><code>&lt;article&gt;
	&lt;header&gt;
		&lt;h1&gt;My major heading&lt;/h1&gt;
		&lt;h2&gt;Subheading&lt;/h2&gt;
		Abstract text...
	&lt;/header&gt;
	... lorem ipsum ....
	&lt;hX&gt;Heading within my article&lt;/hX&gt;
	... dolor sit amet ...
	&lt;hX+1&gt;Subheading in my article&lt;/hX+1&gt;
&lt;/article&gt;</code></pre>
<p>Which heading-level would be appropriate in my example? h1 because it starts again? or h3 because it continues?</p>
<p>Thank you</p>
</blockquote>
<p>If the first <code>&lt;hX&gt;</code> is a new subheading and <em>not related</em> to the <code>&lt;h2&gt;</code> already there, then <code>&lt;hX&gt;</code> would be an <code>&lt;h2&gt;</code>. Then <code>&lt;hX+1&gt;</code> would be an <code>&lt;h3&gt;</code> if it is a subheading of the above <code>&lt;h2&gt;</code>.</p>
<p>However, if you&#8217;re splitting the article into sections, then you <em>could</em> use an <code>&lt;h1&gt;</code> each time. See our article on <a href="http://html5doctor.com/the-section-element/">the section element</a> for more.</p>
<p>Thanks, Tom</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 <abbr>HTML</abbr>5 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-10/" rel="bookmark" class="crp_title">Your Questions Answered #10</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-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</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-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%209%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-9%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-answered-9%2F&amp;title=Your%20Questions%20Answered%209&amp;bodytext=The%20Doctor%20is%20in%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20This%20week%2C%20we%27ll%20cover%20offline%20viewing%20on%20requests%2C%20the%20drag-and-drop%20API%2C%20using%20href%20on%20any%20element%2C%20the%20%26lt%3Bfigure%26gt%3B%20element%2C%20and%20headings." 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-answered-9%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-answered-9%2F&amp;title=Your%20Questions%20Answered%209" 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-answered-9%2F&amp;title=Your%20Questions%20Answered%209&amp;notes=The%20Doctor%20is%20in%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20This%20week%2C%20we%27ll%20cover%20offline%20viewing%20on%20requests%2C%20the%20drag-and-drop%20API%2C%20using%20href%20on%20any%20element%2C%20the%20%26lt%3Bfigure%26gt%3B%20element%2C%20and%20headings." 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-answered-9%2F&amp;title=Your%20Questions%20Answered%209" 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-answered-9%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%209&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-9%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-answered-9%2F&amp;t=Your%20Questions%20Answered%209" 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-answered-9%2F&amp;title=Your%20Questions%20Answered%209&amp;annotation=The%20Doctor%20is%20in%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20This%20week%2C%20we%27ll%20cover%20offline%20viewing%20on%20requests%2C%20the%20drag-and-drop%20API%2C%20using%20href%20on%20any%20element%2C%20the%20%26lt%3Bfigure%26gt%3B%20element%2C%20and%20headings." 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%209&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-9%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-answered-9%2F&amp;t=Your%20Questions%20Answered%209" 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-answered-9%2F&amp;title=Your%20Questions%20Answered%209&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=The%20Doctor%20is%20in%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20This%20week%2C%20we%27ll%20cover%20offline%20viewing%20on%20requests%2C%20the%20drag-and-drop%20API%2C%20using%20href%20on%20any%20element%2C%20the%20%26lt%3Bfigure%26gt%3B%20element%2C%20and%20headings." 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-answered-9%2F&amp;h=Your%20Questions%20Answered%209" 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-answered-9%2F&amp;t=Your%20Questions%20Answered%209&amp;s=The%20Doctor%20is%20in%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20This%20week%2C%20we%27ll%20cover%20offline%20viewing%20on%20requests%2C%20the%20drag-and-drop%20API%2C%20using%20href%20on%20any%20element%2C%20the%20%26lt%3Bfigure%26gt%3B%20element%2C%20and%20headings." 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-answered-9/" rel="bookmark">Your Questions Answered 9</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 14, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-9/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The ruby element and her hawt friends, rt and rp</title>
		<link>http://html5doctor.com/ruby-rt-rp-element/</link>
		<comments>http://html5doctor.com/ruby-rt-rp-element/#comments</comments>
		<pubDate>Tue, 11 May 2010 14:00:55 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[rp]]></category>
		<category><![CDATA[rt]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1745</guid>
		<description><![CDATA[<p>The <code>&#60;ruby&#62;</code>, <code>&#60;rt&#62;</code> and <code>&#60;rp&#62;</code> elements allow us to add ‘ruby’ phonetic annotations in languages like Japanese and Chinese. Despite the terrors of internationalisation and patchy browser support — with a little fiddling and a lot of caution — this sexy threesome with adorable accents are ready to use now.</p>]]></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%2Fruby-rt-rp-element%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p><a href="http://en.wikipedia.org/wiki/Ruby_character" title="Ruby character - Wikipedia, the free encyclopedia">Ruby text</a> is a short annotation for some base text. It’s typically used to give pronunciation guidance in a phonetic script for kanji in Chinese, Japanese, and Korean (<abbr title="Chinese, Japanese and Korean">CJK</abbr>) languages. It’s named after an old printers’ term for the very small size of 5.5 points.</p>

<blockquote cite="http://dev.w3.org/html5/markup/ruby">
<p>The ruby element allows spans of phrasing content to be marked with ruby annotations.</p>
<cite><a href="http://dev.w3.org/html5/markup/ruby" title="HTML5: ruby — ruby annotation (NEW)">W3C Specification</a></cite>
</blockquote>

<p>As the name implies, ruby text is small<!-- IE=6pt, Webkit=60% -->, displayed by default above the base text in horizontal text and to the right in vertical text. Browsers without <code>&lt;ruby&gt;</code> support put the ruby text inline after the base text.</p>

<p>These are the elements used in creating ruby text in <abbr>HTML</abbr>5:</p>

<ul>
<li><code>&lt;ruby&gt;</code> — an inline element that contains base text with ruby annotations</li>
<li><code>&lt;rt&gt;</code> — ruby text, coming after the base text it defines</li>
<li><code>&lt;rp&gt;</code> — ruby parentheses, an element used to wrap opening and closing parentheses around <code>&lt;rt&gt;</code> ruby text. These are for user agents that don’t support ruby text, so that it makes sense when displayed inline. Browsers that support <code>&lt;ruby&gt;</code> hide <code>&lt;rp&gt;</code> via <code>{display:none;}</code>.</li>
</ul>

<section id="examples">
<h2>Examples</h2>

<p>If you’ve never seen ruby in action you’re probably wondering what I’m talking about, so here are some examples:</p>

<figure>
<img src="/wp-content/uploads/2010/05/vagabond.jpg" width="279" height="250" alt="Vagabond">
<figcaption><i lang="ja-latn">Furigana</i> ruby text in the Japanese manga <a href="http://en.wikipedia.org/wiki/Vagabond_(manga)" title="Vagabond (manga) - Wikipedia, the free encyclopedia">Vagabond</a></figcaption>
</figure>

<figure>
<img src="/wp-content/uploads/2010/05/bopomofo-newspaper.png" width="38" height="147" alt="Bopomofo Newspaper" />
<figcaption>Snippet of a <a href="http://wss.djes.tp.edu.tw/report/Lists/Photos/951222%E5%9C%8B%E8%AA%9E%E6%97%A5%E5%A0%B1/%E5%9C%8B%E8%AA%9E%E6%97%A5%E5%A0%B1.jpg" title="Image of a Taiwanese newspaper with bopomofo ruby for students">Taiwanese newspaper for students</a>, with <i lang="zh-latn">bopomofo</i> ruby</figcaption>
</figure>

<figure>
<img src="/wp-content/uploads/2010/05/chosun.png" width="405" height="72" alt="Typical Korean usage of hanji in a Korean news website" />
<figcaption>Korean <i lang="kr-latn">hangul</i> followed by <i lang="kr-latn">hanja</i> in an editorial on <a href="http://news.chosun.com/site/data/html_dir/2010/04/19/2010041902457.html">Chosun.com</a></figcaption>
</figure>

</section>

<section id="browser-support">
<h2>Browser support</h2>

<p>As is often the way with internationalisation features, browser support is — well, sparse. In a break from your expectations, Internet Explorer has supported <code>&lt;ruby&gt;</code> since <abbr>IE</abbr>5 — three years before the actual 2001 <a href="http://www.w3.org/TR/ruby/" title="Ruby Annotation">W3C Ruby Annotation</a> specification! While this specification was incorporated into <a href="http://www.w3.org/TR/xhtml11/changes.html#a_changes" title="XHTML 1.1 - Changes from XHTML 1.0 Strict"><abbr>XHTML</abbr> 1.1</a>, no browser ever implemented it.</p>

<p><code>&lt;ruby&gt;</code> in <abbr>HTML</abbr>5 is based on a reverse-engineering of <abbr>IE</abbr>’s implementation. It also lacks Ruby Annotation’s ‘complex <code>&lt;ruby&gt;</code>’, as these can normally be accomplished via nesting. (Please submit feedback if you have a real-world example that can’t be.) <a href="http://webkit.org/blog/948/ruby-rendering-in-webkit/" title="Surfin’ Safari - Blog Archive  » Ruby Rendering in WebKit">Webkit</a> added <abbr>HTML</abbr>5 <code>&lt;ruby&gt;</code> support at the start of 2010. At the time of writing, <code>&lt;ruby&gt;</code> has made it into Chrome but not Safari. Firefox and Opera have yet to implement <code>&lt;ruby&gt;</code> natively, although there are Firefox extensions for <code>&lt;ruby&gt;</code> support (<a href="http://htmlruby.codeplex.com/" title="HTML Ruby"><abbr>HTML</abbr> Ruby (basic ruby including <abbr>HTML</abbr>5)</a> and <a href="http://piro.sakura.ne.jp/xul/_rubysupport.html.en" title="XUL Apps &gt; XHTML Ruby Support - outsider reflex"><abbr>XHTML</abbr> Ruby (complex ruby)</a>).</p>

<p>On the styling side, there’s the <a href="http://www.w3.org/TR/css3-ruby/" title="CSS3 Ruby Module">W3C <abbr>CSS</abbr>3 Ruby Module</a> (2003). It’s based on Ruby Annotation’s ‘complex ruby’ and is being updated for <abbr>HTML</abbr>5 <code>&lt;ruby&gt;</code>. Because of this, it’s also yet to be implemented beyond the default <abbr>IE</abbr>-level formatting. Ruby text will be used in combination with the <a href="http://dev.w3.org/csswg/css3-text-layout/" title="CSS Text Layout Module Level 3">W3C <abbr>CSS</abbr> Text Layout Module Level 3</a> properties <code>direction</code>, <code>block-flow</code>, and <code>writing-mode</code> for alternative text flow (such as vertical text), but again these have <a href="http://www.zachleat.com/web/2010/02/12/css3-text-writing-mode/" title="CSS 3 Text: A Tale of writing-mode Woe">poor implementation</a>.</p>

<table>
<caption>Summary of browser support for <code>&lt;ruby&gt;</code> display &amp; styling in the five main browsers</caption>
<thead>
<tr>
<th>Browser</th>
<th>Basic <code>&lt;ruby&gt;</code></th>
<th><code>writing-mode</code></th>
<th>‘Complex <code>&lt;ruby&gt;</code>’</th>
<th><abbr>CSS</abbr>3 Ruby (2003)</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Internet Explorer</th>
<td><abbr>IE</abbr>5.5+</td>
<td><abbr>IE</abbr>6+<a href="#css-note1">*</a></td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th scope="row">Firefox</th>
<td>(via plugin)</td>
<td>-</td>
<td>(via plugin)</td>
<td>-</td>
</tr>
<tr>
<th scope="row">Chrome</th>
<td>Chrome5+</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th scope="row">Safari</th>
<td>Safari5+</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th scope="row">Opera</th>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
</tbody>
</table>
<p id="css-note1">Note: <code>writing-mode</code> support in <abbr>IE</abbr>6 was <code>lr-tb</code> and <code>tb-rl</code> only. <a href="http://blogs.msdn.com/ie/archive/2009/05/29/the-css-corner-writing-mode.aspx" title="IEBlog : The CSS Corner: writing-mode"><abbr>IE</abbr>8 added support for all possible combinations</a>.</p>

<section id="usable-css">
<h3><abbr>CSS</abbr> we <em>can</em> use</h3>

<p>Having said that no browsers support the <abbr>CSS</abbr>3 Ruby module yet, there are still a few things we can do to style <code>&lt;ruby&gt;</code> and friends. Default browser styles use <code>font-size</code> and <code>display</code>, so we can safely change these to affect display in both supporting and non-supporting browsers.</p>

<p>If you want to de-emphasise the <code>&lt;rt&gt;</code> ruby text when it’s displayed inline in non-supporting browsers, you could do this via setting the size of <code>&lt;rt&gt;</code> and <code>&lt;rp&gt;</code>, as <abbr>IE</abbr> and Webkit do:</p>

<pre><code>rt, rp {font-size: 60%;} /* = Webkit value */</code></pre>

<p>You can also move ruby text and parentheses to after the base text, mimicking non-supporting browser rendering on supporting browsers:</p>

<pre><code>rt, rp {display: inline; font-size: 100%;}</code></pre>

<p>Finally, if you’re brave/foolish, you can implement ruby display yourself via <abbr>CSS</abbr> <code>inline-table</code> (<a href="http://sideshowbarker.net/2009/11/13/html5-ruby/#comment-3388" title="Carl’s ‘faking ruby’ comment on Mike Smith’s weblog"><abbr>CSS</abbr> with explanation</a> and <a href="http://hiragana.jp/" title="Hiragana Megane (How to Read Japanese)">demonstration (Hiragana.jp)</a>). Note that <a href="https://bugs.webkit.org/show_bug.cgi?id=36803">this currently doesn’t work in Chrome</a> because of a bug with <code>display:inline-table</code> on <code>&lt;ruby&gt;</code> (fixed in trunk), and as you’ll probably need per-browser style tweaks, I recommend against it.</p>

</section>
</section>

<section id="code-samples">
<h2>Code samples and output</h2>

<p><a href="http://oli.jp/example/ruby/" title="Ruby examples ❧ Oli.jp (@boblet)">These code samples</a> (with notes and <abbr>CSS</abbr>) are also available separately.</p>

<section id="ja">
<h3><code>&lt;ruby&gt;</code> in Japanese — <i lang="ja-latn">furigana</i> and <i lang="ja-latn" title="romaji">rōmaji</i></h3>

<section id="without-rp">
<h4>Using <code>&lt;ruby&gt;</code> without <code>&lt;rp&gt;</code></h4>
<figure>
<pre><code>&lt;ruby&gt;攻殻&lt;rt&gt;こうかく&lt;/rt&gt;機動隊&lt;rt&gt;きどうたい&lt;/rt&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/gits.png" width="100" height="50" alt="Furigana example using ruby in a supporting browser (displayed above base text)" />
<img src="/wp-content/uploads/2010/05/gits-inline.png" width="235" height="50" alt="Furigana example using ruby in a non-supporting browser (displayed inline after base text)">
<figcaption>Using <code>&lt;ruby&gt;</code> to indicate the pronunciation of the Japanese name of the <a href="http://en.wikipedia.org/wiki/Ghost_in_the_shell" title="Ghost in the Shell - Wikipedia, the free encyclopedia">Ghost in the Shell anime series</a> in <i lang="ja-latn">furigana</i>. Notice that the lack of <code>&lt;rp&gt;</code> makes it pretty unreadable in a non-supporting browser (you may have to trust me on this!).<!-- this could be faked in browsers supporting generated content via rt:before {content: "(";} and rt:after {content: ")";}, but you can’t then turn it off for supporting browsers --></figcaption>
</figure>
</section>

<section id="with-rp">
<h4>Using <code>&lt;ruby&gt;</code> with <code>&lt;rp&gt;</code></h4>
<figure>
<pre><code>&lt;ruby&gt;攻殻&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;こうかく&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;機動隊&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;きどうたい&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/gits.png" width="100" height="50" alt="Furigana example using ruby in a supporting browser (displayed above base text)" />
<img src="/wp-content/uploads/2010/05/gits-parentheses.png" width="300" height="50" alt="Furigana example using ruby in a non-supporting browser (displayed inline with parentheses)" />
<figcaption>The above example with <code>&lt;rt&gt;</code> text surrounded by <code>&lt;rp&gt;</code> parentheses degrades gracefully on non-supporting browsers.</figcaption>
</figure>
</section>

<section id="nested-ruby">
<h4>Nested <code>&lt;ruby&gt;</code> for multiple ruby texts</h4>
<figure>
<pre><code>&lt;ruby&gt;&lt;ruby&gt;攻&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;こう&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;殻&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;かく&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;機&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;き&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;動&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;どう&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;隊&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;たい&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;&lt;/ruby&gt;&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;Kōkakukidōtai&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/gits-two-ruby.png" width="110" height="50" alt="Two ruby texts in a supporting browser (both displayed above base text)">
<img src="/wp-content/uploads/2010/05/gits-two-ruby-paren.png" width="520" height="36" alt="Two ruby texts in a non-supporting browser (displayed inline in source order)">
<figcaption>The scope of <code>&lt;rt&gt;</code> depends on the amount of base text before it, from one character to an entire phrase. <code>&lt;ruby&gt;</code> can also be nested to provide multiple ruby texts for one base text — in this case <i lang="ja-latn">furigana</i> and <i lang="ja-latn" title="romaji">rōmaji</i>. Although per-kanji <code>&lt;ruby&gt;</code> is more informative, it degrades somewhat poorly in non-supporting browsers. Copy &amp; paste support is also poor, as browsers just use source order, for example “攻こう殻かく機き動どう隊たい Kōkakukidōtai”. It’s also a <abbr title="pain in the arse">PITA</abbr> to code <img src='http://html5doctor.com/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </figcaption>
</figure>
</section>

<!-- Example of vertical text? -->

<section id="jp-glossary">
<h4>Japanese glossary</h4>

<p><i lang="ja-latn">Furigana</i> is the name given to using <i lang="ja-latn">hiragana</i> phonetic script beside words written in kanji to aid reading. It’s used extensively in education for learners of Japanese, and in reading material for children. It’s also sometimes used when writing kanji a literate adult may not be able to read.</p>

<p><i lang="ja-latn" title="romaji">Rōmaji</i> is the romanisation of Japanese into the latin alphabet. <i lang="ja-latn" title="romaji">Rōmaji</i> is generally used for those who don’t know Japanese, especially in signage and tourism information.</p>
</section>

</section>

<section id="zh">
<h3><code>&lt;ruby&gt;</code> in Chinese — <i lang="zh-latn" title="pinyin">Pīnyīn</i> and <i lang="zh-latn" Title="Zhuyin Fuhao">zhùyīn fúhào</i> (<i lang="zh-latn">bopomofo</i>)</h3>

<p>Ruby is used to some extent in China (<i lang="zh-latn" title="pinyin">pīnyīn</i>), and more so in Taiwan (<i lang="zh-latn" Title="Zhuyin Fuhao">zhùyīn fúhào</i>), especially in textbooks and signage.</p>

<section id="pinyin">
<h4><i lang="zh-latn" title="pinyin">Pīnyīn</i></h4>
<figure>
<pre><code>&lt;p&gt;The &lt;b&gt;Grass mud horse&lt;/b&gt; — &lt;ruby&gt;草泥馬&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;Cǎo Ní Mǎ&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;/ruby&gt; — is … characterised as “lively, intelligent and tenacious”. However, their existence is said to be threatened by the “river crabs” — &lt;ruby class="styled"&gt;河蟹&lt;rp&gt; (&lt;/rp&gt;&lt;rt&gt;héxiè&lt;/rt&gt;&lt;rp&gt;) &lt;/rp&gt;&lt;/ruby&gt; — which are invading their habitat.&lt;/p&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/gmh.png" width="570" height="100" alt="Ruby text in a paragraph of text in a supporting browser, leading to significant line-height differences">
<img src="/wp-content/uploads/2010/05/gmh-combo.png" width="570" height="80" alt="Ruby text in a non-supporting browser, with font-size set on rt and rp elements for the second ruby instance">
<figcaption>In this example of <i lang="zh-latn">pinyin</i> you can see how <code>&lt;ruby&gt;</code> significantly affects the leading (<code>&lt;line-height&gt;</code>) of text blocks in supporting browsers. Setting <code>font-size</code> for <code>&lt;rt&gt;</code> and <code>&lt;rp&gt;</code> can de-emphasise ruby text in non-supporting browsers, as demonstrated in the second <code>&lt;ruby&gt;</code> in the second image.</figcaption>
</figure>
</section>

<section id="bopomofo">
<h4><i lang="zh-latn" Title="Zhuyin Fuhao">Zhùyīn fúhào</i></h4>
<figure>
<pre><code>&lt;ruby&gt;&lt;ruby&gt;世&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄕˋ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;上&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄕㄤˋ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;無&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄨˊ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;難&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄋㄢˊ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;事&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄕˋ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;只&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄓˇ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;怕&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄆㄚˋ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;有&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄧㄡˇ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;心&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄒㄧㄣ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;人&lt;rp&gt;（&lt;/rp&gt;&lt;rt&gt;ㄖㄣˊ&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;&lt;/ruby&gt;&lt;rp&gt; （&lt;/rp&gt;&lt;rt&gt;Anything can be done with enough perseverance&lt;/rt&gt;&lt;rp&gt;）&lt;/rp&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/bopomofo.png" width="471" height="56" alt="How this bopomofo *should* look in a supporting browser (which doesn’t exist as far as I know)" />
<img src="/wp-content/uploads/2010/05/bopomofo-chrome.png" width="230" height="55" alt="This bopomofo example in Chrome" />
<img src="/wp-content/uploads/2010/05/bopomofo-firefox.png" width="467" height="84" alt="This bopomofo example in Firefox" />
<!-- http://en.wikiquote.org/wiki/Chinese_proverbs -->
<figcaption>Unfortunately, no browser can render this example of <i lang="zh-latn" Title="Zhuyin Fuhao">Zhùyīn fúhào</i> (<i lang="zh-latn">bopomofo</i>) ruby on horizontal Mandarin Chinese correctly. I’ve included an ideal rendering and how it appears in both a browser supporting simple ruby (with incorrectly rendered <i lang="zh-latn">bopomofo</i>) and a non-supporting browser.</figcaption>
</figure>
</section>

<section id="zh-glossary">
<h4>Chinese glossary</h4>
<p><a href="http://en.wikipedia.org/wiki/Pinyin" title="Pinyin - Wikipedia, the free encyclopedia"><i lang="zh-latn" title="pinyin">Pīnyīn</i></a> is a romanised phonetic system for Chinese, generally written above or after the word. <a href="http://en.wikipedia.org/wiki/Bopomofo" title="Bopomofo - Wikipedia, the free encyclopedia"><i lang="zh-latn">Bopomofo</i> (<i lang="zh-latn" Title="Zhuyin Fuhao">Zhùyīn fúhào</i>)</a> is a phonetic script for transcribing Chinese, especially Mandarin. It is generally written (in both horizontal and vertical scripts) vertically to the right of each <i lang="ja-latn">hanzi</i> character.</p>
</section>
</section>

<section id="ko">
<h3>Korean ruby</h3>
<p>While the use of <i lang="ko-latn">hanja</i> (kanji) is decreasing in South Korea, they are still used for disambiguation and proper names.</p>

<figure>
<pre><code>&lt;ruby&gt;한자&lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;漢字&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/hanja.png" alt="Hangul followed inline by hanja in brackets">
<figcaption>Current Korean ruby use is to have the <i lang="kr-latn">hangul</i> coming <em>before</em> the <i lang="kr-latn">hanja</i> in parentheses (the opposite way from the default fallback style). For styling use: <code>rt, rp {display: inline; font-size: 100%;}</code>. This formatting is also used when foreign words such as English are included in Korean text.</figcaption>
</figure>

<section id="ko-glossary">
<h4>Korean glossary</h4>
<p><a href="http://en.wikipedia.org/wiki/Hangul" title="Hangul - Wikipedia, the free encyclopedia"><i lang="kr-latn">Hangul</i></a> is the Korean script, and <a href="http://en.wikipedia.org/wiki/Hanja" title="Hanja - Wikipedia, the free encyclopedia"><i lang="kr-latn">hanja</i></a> is Korean for Chinese characters. Traditionally written Korean used <i lang="kr-latn">hanja</i>, but now it’s mainly used in academic texts and occasionally for disambiguation.</p>
</section>
</section>

<section id="en">
<h3>Using <code>&lt;ruby&gt;</code> for English</h3>

<p>Not everyone is using East Asian languages, but any short annotation is (theoretically) applicable. While English doesn’t typically have pronunciation guidance, phonetic annotations are used in dictionaries:</p>

<!-- styled to make rt appear inline -->
<figure>
<pre><code>&lt;ruby&gt;&lt;strong&gt;cromulent&lt;/strong&gt; &lt;rp&gt;(&lt;/rp&gt;&lt;rt&gt;crôm-yü-lənt&lt;/rt&gt;&lt;rp&gt;)&lt;/rp&gt;&lt;/ruby&gt;</code></pre>
<img src="/wp-content/uploads/2010/05/cromulent.png" width="570" height="80" alt="Displaying ruby text after the base text for an English dictionary">
<figcaption>Using ruby text for a dictionary definition by displaying the ruby text inline after the base text</figcaption>
</figure>
</section>
</section>

<section id="use-it">
<h2><code>&lt;ruby&gt;</code>: to use or not to use</h2>

<p>The main use case of <code>&lt;ruby&gt;</code> is marking up pronunciation in Asian writing, such as <i lang="zh-latn" title="phonetic system for transcribing Chinese">bopomofo</i> for traditional Chinese and <i lang="ja-latn" title="addition of small kana next to kanji to aid reading">furigana</i> for Japanese. I don’t know whether Arabic diacritics like Taškīl, Hebrew Niqqud, or other non-<abbr title="Chinese, Japanese and Korean languages">CJK</abbr> languages would use <code>&lt;ruby&gt;</code> for marking up phonetic annotations or diacritics. The <abbr>WHATWG</abbr> specification says:</p>

<blockquote>
<p>Ruby annotations are short runs of text presented alongside base text, primarily used in East Asian typography as a guide for pronunciation or to include other annotations</p>
<footer><cite><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-ruby-element" title="4.6 Text-level semantics &mdash; HTML5 (including next generation additions still in development)">WHATWG specification</a></cite></footer>
</blockquote>

<p>As someone who uses tools like <a href="http://www.popjisyo.com/WebHint/Portal_e.aspx" title="POPjisyo.com - Dictionary Translation Japanese/Chinese/Korean/Kanji/Hanzi">Popjisyo</a> to add pop-up readings and translations to kanji, I definitely see <code>&lt;ruby&gt;</code> as semantic (and valuable) for ‘phonetic annotation,’ in the same way that <code>&lt;abbr&gt;</code> provides extra information on potentially confusing content. Outside of this usage, however, <code>&lt;ruby&gt;</code> could be seen as a presentational hack. Oh noes! I believe the Korean and English examples above are valid uses, but much like <code>&lt;q&gt;</code> some people think the extra code of using <code>&lt;ruby&gt;</code> is not justified when the default presentation is the same as plain text.</p>

<p>To further muddy the waters, the 2001 W3 Ruby specification included an <a href="http://www.w3.org/TR/ruby/#fig1.6" title="Ruby Annotation">abbreviated word marked up with a visible definition via <code>&lt;ruby&gt;</code></a>, and <a href="http://www.w3.org/TR/ruby/#fig1.9" title="Ruby Annotation">a use-by date where the day, month, and year are added via <code>&lt;ruby&gt;</code></a>. These uses seem like presentational hacks to me, and while they’re not forbidden, the lack of such examples in <abbr>HTML</abbr>5 indicate they’re not exactly blessed either <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
</section>

<section id="conclusion">
<h2>In conclusion…</h2>

<p>The most important thing is that the <code>&lt;ruby&gt;</code>, <code>&lt;rt&gt;</code>, and <code>&lt;rp&gt;</code> elements are <em>valid <abbr>HTML</abbr>5</em>, and even if they’re not officially supported, they will by default display <em>as if they were <code>&lt;span&gt;</code>s</em> in non-supporting browsers. Because of this, <strong>if you actually need to use <code>&lt;ruby&gt;</code>, especially for phonetic annotations, do it</strong>! It might not look perfect yet in non-supporting browsers, but this will change, and hey, at least you don’t have <abbr>IE</abbr> support to worry about! <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>For non-phonetic annotation, consider using <code>&lt;abbr&gt;</code> to give an expanded reading via mouse-over for an abbreviation or acronym, unless displaying the reading by default is important. Consider <code>&lt;small&gt;</code> for <em>phrasing content</em>-level side comments, if the comment placement is not important and the association with the relevant content doesn’t need to be explicit.</p>
</section>

<section id="ref">
<h2>Further reading</h2>

<ul>
<li><a href="http://webkit.org/blog/948/ruby-rendering-in-webkit/" title="Surfin&#8217; Safari - Blog Archive  &raquo; Ruby Rendering in WebKit">Ruby rendering in Webkit</a> announcement on the Safari weblog</li>
<li><a href="http://my.opera.com/tagawa/blog/the-html5-ruby-element-in-words-of-one-syllable-or-less" title="Daniel Davis - The HTML5 &lt;ruby&gt; element in words of one syllable or less">The <abbr>HTML</abbr>5 &lt;ruby&gt; element in words of one syllable or less</a> by the unstoppable <a href="http://twitter.com/ourmaninjapan" title="Daniel Davis on Twitter @ourmaninjapan">Daniel Davis</a> of Opera</li>
</ul>
</section>

<section id="feedback">
<h2>Feedback please!</h2>

<p>So what do you think of <code>&lt;ruby&gt;</code> and friends? Let us know in the comments! If you know about the use of annotations like this in other languages, or have used <code>&lt;ruby&gt;</code>, tell us about it too!</p>

<!-- Bonus for source readers…

Questions to Hixie:
* would the expiry date would still be valid
* why was complex ruby dropped? no use case?
* would the WWW abbr-as-ruby would still be valid (what about <ruby><abbr>WWW</abbr><rt>world wide web</rt></ruby>)

Answers:
* HTML5 ruby is basically what IE supports
* complex ruby may return in future if there’s a definite use case for it that can’t be solved by nested ruby
* Hixie thought the non-language uses were a bit dodgy <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  -->
</section><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/i-b-em-strong-element/" rel="bookmark" class="crp_title">The i, b, em, &amp; strong elements</a></li><li><a href="http://html5doctor.com/small-hr-element/" rel="bookmark" class="crp_title">The small &amp; hr elements</a></li><li><a href="http://html5doctor.com/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</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><li><a href="http://html5doctor.com/summary-figcaption-element/" rel="bookmark" class="crp_title">Hello, summary and figcaption elements</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp%20-%20http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;bodytext=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." 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%2Fruby-rt-rp-element%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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" 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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;notes=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." 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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" 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%2Fruby-rt-rp-element%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=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%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%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" 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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;annotation=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." 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=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%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%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" 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%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." 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%2Fruby-rt-rp-element%2F&amp;h=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" 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%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;s=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." 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/ruby-rt-rp-element/" rel="bookmark">The ruby element and her hawt friends, rt and rp</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 11, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/ruby-rt-rp-element/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #8</title>
		<link>http://html5doctor.com/your-questions-answered-8/</link>
		<comments>http://html5doctor.com/your-questions-answered-8/#comments</comments>
		<pubDate>Wed, 05 May 2010 13:00:55 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[footer]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[outline]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1775</guid>
		<description><![CDATA[We're back with more of your questions (and our answers) about <abbr>HTML</abbr>5. In this article, we'll discuss using a <code>&#60;footer&#62;</code> at the top of your markup, how to skip to certain parts of a video, styling form elements and attributes, and more.]]></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-answered-8%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-8%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 more of your questions (and our answers) about <abbr>HTML</abbr>5. In this article, we&#8217;ll discuss using a <code>&lt;footer&gt;</code> at the top of your markup, how to skip to certain parts of a video, styling form elements and attributes, and more.</p>
<h2><abbr>HTML</abbr>5 <code>&lt;footer&gt;</code> on top</h2>
<p>David asked:</p>
<blockquote><p>Hi!</p>
<p>I wonder if it possible to put the footer on top such as www.perfectfools.com with <abbr>HTML</abbr>5 and still make the <abbr>HTML</abbr> validate.</p>
<p>Thanks a lot and best regards!</p>
<p>David</p>
</blockquote>
<p><abbr>HTML</abbr> elements should always describe their content, so if you think that <code>&lt;footer&gt;</code> is most suitable for your content, then you&#8217;re absolutely entitled to use it. Despite its name, <code>&lt;footer&gt;</code>&#8217;s position is in no way restricted — visually or ordinally — within a document.</p>
<p>Cheers, Rich</p>
<h2>Skip to certain parts of a video file</h2>
<p>John Paul asked:</p>
<blockquote><p>Hello</p>
<p>supposing I have a very long video file in an accompanying video element, without using the controls, how do I skip to certain time stages through the <abbr>API</abbr>? Much as one would on a <abbr>DVD</abbr> menu, for example.</p>
<p>Apologies if this has been asked already.</p>
<p>JP</p>
</blockquote>
<p>You can achieve this using JavaScript and <code>data</code> attributes. Check out these articles from Bruce Lawson and Patrick Lauke from Opera. They&#8217;ve used <code>data</code> attributes to add subtitles, but you could just as easily use the attributes to jump to specific parts of a video.</p>
<ul>
<li><a href="http://dev.opera.com/articles/view/introduction-html5-video/">Introduction to HTML5 video</a></li>
<li><a href="http://dev.opera.com/articles/view/accessible-html5-video-with-javascripted-captions/">Accessible <abbr>HTML</abbr>5 video with scripted captions</a></li>
</ul>
<p>For example, set <code>data-start</code> and <code>data-end</code> attributes on your <code>&lt;video&gt;</code> element. You can then use JavaScript to read the attribute values, set the current position of the video using the <code>currentTime</code> attribute, start playing the video via the <code>play()</code> method, and even stop playing the video by listening for the <code>timeupdate</code> event and stopping the video with <code>pause()</code> once it&#8217;s reached a specified time. See <a href="http://www.w3.org/TR/html5/video.html#media-elements">the spec for the HTMLMediaElement object</a> for more details.</p>
<p>Cheers, Rich</p>
<p><small>In addition to this, the recent addition of <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-track-element">the <code>track</code> element</a> will make this more easily achievable. We will cover the <code>track</code> element in more detail soon.</small></p>
<h2><code>&lt;h1&gt;</code>s within navigation links</h2>
<p>Benjamin asked:</p>
<blockquote><p>Hey,</p>
<p>I&#8217;m currently doing up the new version of my website, and decided to do it in <abbr>HTML</abbr>5.</p>
<p>One area I&#8217;m confused about is whether or not for navigation links I should be using a h1 or h2 element.</p>
<p>For example:</p>
<pre><code>&lt;nav id="nav-actions"&gt;
    &lt;header&gt;
        &lt;h1&gt;&lt;span class="title"&gt;Actions&lt;/span&gt;&lt;/h1&gt;
    &lt;/header&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="#"&gt;&lt;span class="title"&gt;Sitemap&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;&lt;span class="title"&gt;Login&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li id="action-search"&gt;&lt;a href="#"&gt;&lt;span class="title"&gt;Search&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
        &lt;li id="action-enquire"&gt;&lt;a href="#"&gt;&lt;span class="title"&gt;Enquire&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
&lt;/nav&gt;</code></pre>
<p>Should those span.title elements be wrapped in a h2? My thoughts on why this would be required is for an outline, as navigation should appear in the outline right?</p>
<p>Thanks a bunch.</p>
</blockquote>
<p>In theory, yes, navigation should appear in the outline. I personally don&#8217;t think it <em>should</em> require a heading, and I know there have been requests to the developers of the outline algorithm to make <code>&lt;nav&gt;</code> show as a &#8216;Navigation&#8217; element rather than &#8216;untitled section&#8217;.</p>
<p>If you want to use a heading within your <code>&lt;nav&gt;</code> element, using an <code>&lt;h1&gt;</code> would be fine. You don&#8217;t really need the <code>&lt;header&gt;</code> element in there too. The outline would be calculated correctly without it. With current browser implementations, however, I don&#8217;t think it would make much difference if you used an <code>&lt;h2&gt;</code>.</p>
<p>You don&#8217;t need the <code>&lt;span&gt;</code> elements in the <code>&lt;h2&gt;</code>s. They aren&#8217;t required in the outline unless they&#8217;re providing a table of contents for the document.</p>
<p>I hope that answers your question. We plan to write an article regarding outlining soon.</p>
<p>Cheers, Rich</p>
<h2>Styling supported <abbr>HTML</abbr>5 form elements and attributes</h2>
<p>Mike asked:</p>
<blockquote><p>First off, I wanted to say I really appreciate the service this site is doing. I have found this site to be a very valuable resource and is always the first place I look when I have a question about implementing <abbr>HTML</abbr>5.</p>
<p>How do I style/edit/change the <abbr>UI</abbr> generated feedback for the new <abbr>HTML</abbr>5 form elements and attributes. For example, In Opera, is there a standard <abbr>CSS</abbr> notation to style the error message so that it doesn&#8217;t necessarily show up under the field in red? Where in the DOM is it inserted? Is the message for a required field customizable? Finally, is this information specified in the <abbr>HTML</abbr>5 spec or are the implementation details left up to the browsers?</p>
</blockquote>
<p>There is currently no way to use <abbr>CSS</abbr> to style error messages. As the <abbr>HTML</abbr>5 spec isn&#8217;t finished yet, it&#8217;s a bit early to start specifying new <abbr>CSS</abbr>.</p>
<p>The <abbr>HTML</abbr>5 spec defines no <abbr>UI</abbr> requirements regarding how browsers should display messages.</p>
<p>You <em>can</em> override a browser&#8217;s default behaviour with JavaScript. I&#8217;m not a scripter, but I reckon you would need to attach an event handler to the error event and have the handler cancel the default action and show a custom error message. I think that as long as you call <code>evt.preventDefault()</code> within the event handler, it should prevent showing the default error message. Then you can add an element into the DOM and style it as you wish, with the default error handling as a fallback for those without JavaScript. If anyone gives this a go and gets it working, we&#8217;d be very interested to see the results.</p>
<p>Ta, Bruce</p>
<h2>Section headers</h2>
<p>Tibor asked:</p>
<blockquote><p>Hi. I would like to know, how to use section&#8217;s headers. Is this code correct?</p>
<pre><code>&lt;aside&gt;
	&lt;h1&gt;header 1&lt;/h1&gt;
&lt;/aside&gt;
&lt;article&gt;
	&lt;h1&gt;header 2&lt;/h1&gt;
&lt;/article&gt;</code></pre>
<p>or I have to use header element inside every aside, article, section etc.</p>
<pre><code>&lt;aside&gt;
	&lt;header&gt;
    	&lt;h1&gt;header 1&lt;/h1&gt;
	&lt;/header&gt;
&lt;/aside&gt;
&lt;article&gt;
	&lt;header&gt;
    	&lt;h1&gt;header 2&lt;/h1&gt;
	&lt;/header&gt;
&lt;/article&gt;</code></pre>
<p>Tibor</p>
</blockquote>
<p>Your first example is correct. You only need <code>&lt;header&gt;</code> to group items within a header. If the header contains only a single <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code> element, you don&#8217;t need to wrap it in a <code>&lt;header&gt;</code>.</p>
<p>Thanks, Bruce</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 <abbr>HTML</abbr>5 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-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</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-4/" rel="bookmark" class="crp_title">Your Questions Answered #4</a></li>
<li><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark" class="crp_title">Video: the track element and webM codec</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%238%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-8%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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238&amp;bodytext=We%27re%20back%20with%20more%20of%20your%20questions%20%28and%20our%20answers%29%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20a%20%26lt%3Bfooter%26gt%3B%20at%20the%20top%20of%20your%20markup%2C%20how%20to%20skip%20to%20certain%20parts%20of%20a%20video%2C%20styling%20form%20elements%20and%20attributes%2C%20and%20more." 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-answered-8%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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238" 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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238&amp;notes=We%27re%20back%20with%20more%20of%20your%20questions%20%28and%20our%20answers%29%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20a%20%26lt%3Bfooter%26gt%3B%20at%20the%20top%20of%20your%20markup%2C%20how%20to%20skip%20to%20certain%20parts%20of%20a%20video%2C%20styling%20form%20elements%20and%20attributes%2C%20and%20more." 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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238" 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-answered-8%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%238&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-8%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-answered-8%2F&amp;t=Your%20Questions%20Answered%20%238" 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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238&amp;annotation=We%27re%20back%20with%20more%20of%20your%20questions%20%28and%20our%20answers%29%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20a%20%26lt%3Bfooter%26gt%3B%20at%20the%20top%20of%20your%20markup%2C%20how%20to%20skip%20to%20certain%20parts%20of%20a%20video%2C%20styling%20form%20elements%20and%20attributes%2C%20and%20more." 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%238&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-8%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-answered-8%2F&amp;t=Your%20Questions%20Answered%20%238" 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-answered-8%2F&amp;title=Your%20Questions%20Answered%20%238&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%27re%20back%20with%20more%20of%20your%20questions%20%28and%20our%20answers%29%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20a%20%26lt%3Bfooter%26gt%3B%20at%20the%20top%20of%20your%20markup%2C%20how%20to%20skip%20to%20certain%20parts%20of%20a%20video%2C%20styling%20form%20elements%20and%20attributes%2C%20and%20more." 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-answered-8%2F&amp;h=Your%20Questions%20Answered%20%238" 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-answered-8%2F&amp;t=Your%20Questions%20Answered%20%238&amp;s=We%27re%20back%20with%20more%20of%20your%20questions%20%28and%20our%20answers%29%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20a%20%26lt%3Bfooter%26gt%3B%20at%20the%20top%20of%20your%20markup%2C%20how%20to%20skip%20to%20certain%20parts%20of%20a%20video%2C%20styling%20form%20elements%20and%20attributes%2C%20and%20more." 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-answered-8/" rel="bookmark">Your Questions Answered #8</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 5, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-8/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #7</title>
		<link>http://html5doctor.com/your-questions-answered-7/</link>
		<comments>http://html5doctor.com/your-questions-answered-7/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:10:51 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[hgroup]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[section]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1584</guid>
		<description><![CDATA[Here we are again with another round up of  patient questions about <abbr>HTML</abbr>5. In this article, we'll be covering a host of topics including <abbr>AJAX</abbr>, the eternal question of <code>div</code> or <code>section</code>, how to markup multiple blocks of content in a sidebar and using <code>header</code> with <code>hgroup</code>.]]></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-answered-7%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-7%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" /> Here we are again with another round of patient questions about <abbr>HTML</abbr>5. In this article, we&#8217;ll be covering AJAX, the eternal question of <code>&lt;div&gt;</code> or <code>&lt;section&gt;</code>, our old friend Internet Explorer, how to mark up multiple blocks of content in a sidebar, and using <code>&lt;header&gt;</code> with <code>&lt;hgroup&gt;</code>.</p>
<h2><abbr>HTML</abbr> and AJAX</h2>
<p>Arie asked:</p>
<blockquote><p>I&#8217;m still learning about <abbr>html</abbr>5 and javascript, I&#8217;m wondering how <abbr>html</abbr>5 makes doing a lot of the things currently done in ajax and javascript more simple.  Is it by providing things like the canvas that unify ideas?</p>
</blockquote>
<p>Certain parts of <abbr>HTML</abbr>5 will indeed simplify or reduce the need for JavaScript. One such area of improvement is Web Forms 2.0, which will handle client-side form validation in the browser and provide new input types (like <code>&lt;input type="email"&gt;</code> that checks for a valid email address). Of course, you&#8217;ll still need to validate your forms on the server, but at least the browser will catch the most obvious mistakes before the user actually submits the form.</p>
<p>Other parts of <abbr>HTML</abbr>5, like <a href="http://html5doctor.com/introducing-web-sql-databases/">Web SQL Databases</a> and <code>&lt;canvas&gt;</code>, are essentially JavaScript <abbr>API</abbr>s. They may not cut down on your need for JavaScript, but they do provide a consistent interface to some powerful functionality and will enable your application or site to do more things within (or outside of) the browser.</p>
<p>Cheers, Rich</p>
<h2><code>&lt;div&gt;</code> or <code>&lt;section&gt;</code>?</h2>
<p>Paul asked:</p>
<blockquote><p>Hello</p>
<p>I see you are using divs on your website, I thought divs should be replaced by more semantic tags such as sections or article. what did I miss?</p>
<p>Thanks</p>
</blockquote>
<p>Hi Paul,</p>
<p>Just like with <abbr>HTML</abbr>4, you shouldn&#8217;t use <code>&lt;div&gt;</code>s or <code>&lt;span&gt;</code>s where another, more precise element would fit the bill. But for grouping arbitrary content, <code>&lt;div&gt;</code>s and <code>&lt;span&gt;</code>s remain the way to go.</p>
<p>Thanks, Bruce</p>
<h2><abbr>HTML</abbr>5 and <abbr>IE</abbr>6</h2>
<p>Adam asked:</p>
<blockquote><p>Greetings HTML5 Doctor,</p>
<p>Is it at all possible to have a <abbr>HTML</abbr>5 layout while 30% of our users are running <abbr>IE</abbr>6? We are an <abbr>IT</abbr> company and our website is very large so having separate versions is completely impractical. <abbr>HTML</abbr>5 would allow us to move on and keep our markup a lot simpler but with no concrete guarantees regarding universal support is <abbr>HTML</abbr>5 ever going to get off the ground within 5 years while not having to resort to javascript solutions?</p>
</blockquote>
<p>Simply change the doctype and you&#8217;ll be writing <abbr>HTML</abbr>5! If you want to use new elements, however, you&#8217;ll need to use JavaScript to support them (for all versions of <abbr>IE</abbr> up to <abbr>IE</abbr>8). The best place to start? Read <a href="http://html5doctor.com/author/remys/">Remy&#8217;s</a> article on <a href="http://html5doctor.com/how-to-get-html5-working-in-ie-and-firefox-2/">How to get <abbr>HTML</abbr>5 working in <abbr>IE</abbr> and Firefox 2</a>.</p>
<p>I think we&#8217;re in a position to do something about this. By using the new doctype, block-level links, and new form input types (that degrade gracefully), we can start promoting <abbr>HTML</abbr>5 <em>right now</em>.</p>
<p>Cheers, Rich</p>
<h2>Multiple blocks in a sidebar</h2>
<p>Bart asked:</p>
<blockquote><p>On my page (revora.net) I have a sidebar with content that I deem appropriate for the <code>aside</code> element. The sidebar contains several blocks of content. I&#8217;ve currently made the whole bar <code>aside</code> and made the blocks <code>div</code>. Is this correct, or should I do it the other way around?</p>
</blockquote>
<p>It sounds like your first approach is correct. The <code>&lt;div&gt;</code>s might be <code>&lt;section&gt;</code>s or maybe <code>&lt;nav&gt;</code> elements though, depending on their content. I suggest you read our article (and the comments) on <a href="http://html5doctor.com/aside-revisited/">the <code>&lt;aside&gt;</code> element</a>.</p>
<p>Thanks, Tom</p>
<h2>Header with <code>&lt;hgroup&gt;</code></h2>
<p>Diego asked:</p>
<blockquote><p>Hi,</p>
<p>This structure is right?</p>
<pre><code>&lt;section id="choose-tip"&gt;
   &lt;header&gt;
       &lt;hgroup&gt;
           &lt;h1&gt;Foo Bar&lt;/h1&gt;
           &lt;h2&gt;Baz Bat Qux&lt;/h2&gt;
       &lt;/hgroup&gt;
   &lt;/header&gt;
   &lt;p&gt;lorem ipsum&lt;/p&gt;
&lt;/section&gt;</code></pre>
<p>What I mean is, if I have a HEADER with just 2 H(n) I need to put these into a HGROUP ? Or&#8230; I can remove the HEADER and leave just a HGROUP? What&#8217;s the better solutions for it?</p>
<p>Thanks for all,</p>
<p>Diego Tres</p>
</blockquote>
<p>What you have is correct. Basically, in the document outline, you will only see &#8220;Foo Bar&#8221; as the heading for that section. &#8220;Baz Bat Qux&#8221; will be hidden from the outline.</p>
<p>You don&#8217;t <em>have</em> to use a <code>&lt;header&gt;</code> within your <code>&lt;section&gt;</code> or an <code>&lt;hgroup&gt;</code> within your <code>&lt;header&gt;</code>. Similarly, you don&#8217;t <em>have</em> to use a <code>&lt;header&gt;</code> around your <code>&lt;hgroup&gt;</code>.</p>
<p>To summarise, the best solution (if you don&#8217;t require the <code>&lt;h2&gt;</code> to appear in the document outline) is what you&#8217;ve already got.</p>
<p>Cheers, Rich</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 <abbr>HTML</abbr>5 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-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/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</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%237%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-7%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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237&amp;bodytext=Here%20we%20are%20again%20with%20another%20round%20up%20of%20%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20be%20covering%20a%20host%20of%20topics%20including%20AJAX%2C%20the%20eternal%20question%20of%20div%20or%20section%2C%20how%20to%20markup%20multiple%20blocks%20of%20content%20in%20a%20sidebar%20and%20using%20header%20with%20hgroup." 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-answered-7%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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237" 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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237&amp;notes=Here%20we%20are%20again%20with%20another%20round%20up%20of%20%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20be%20covering%20a%20host%20of%20topics%20including%20AJAX%2C%20the%20eternal%20question%20of%20div%20or%20section%2C%20how%20to%20markup%20multiple%20blocks%20of%20content%20in%20a%20sidebar%20and%20using%20header%20with%20hgroup." 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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237" 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-answered-7%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%237&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-7%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-answered-7%2F&amp;t=Your%20Questions%20Answered%20%237" 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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237&amp;annotation=Here%20we%20are%20again%20with%20another%20round%20up%20of%20%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20be%20covering%20a%20host%20of%20topics%20including%20AJAX%2C%20the%20eternal%20question%20of%20div%20or%20section%2C%20how%20to%20markup%20multiple%20blocks%20of%20content%20in%20a%20sidebar%20and%20using%20header%20with%20hgroup." 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%237&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-7%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-answered-7%2F&amp;t=Your%20Questions%20Answered%20%237" 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-answered-7%2F&amp;title=Your%20Questions%20Answered%20%237&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Here%20we%20are%20again%20with%20another%20round%20up%20of%20%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20be%20covering%20a%20host%20of%20topics%20including%20AJAX%2C%20the%20eternal%20question%20of%20div%20or%20section%2C%20how%20to%20markup%20multiple%20blocks%20of%20content%20in%20a%20sidebar%20and%20using%20header%20with%20hgroup." 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-answered-7%2F&amp;h=Your%20Questions%20Answered%20%237" 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-answered-7%2F&amp;t=Your%20Questions%20Answered%20%237&amp;s=Here%20we%20are%20again%20with%20another%20round%20up%20of%20%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20be%20covering%20a%20host%20of%20topics%20including%20AJAX%2C%20the%20eternal%20question%20of%20div%20or%20section%2C%20how%20to%20markup%20multiple%20blocks%20of%20content%20in%20a%20sidebar%20and%20using%20header%20with%20hgroup." 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-answered-7/" rel="bookmark">Your Questions Answered #7</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 20, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-7/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>The figure &amp; figcaption elements</title>
		<link>http://html5doctor.com/the-figure-figcaption-elements/</link>
		<comments>http://html5doctor.com/the-figure-figcaption-elements/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 13:45:20 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[figcaption]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1646</guid>
		<description><![CDATA[<p>In traditional printed material like books and magazines, an image, chart, or code example would be accompanied by a caption. Before now, we didn't have a way of semantically marking up this sort of content directly in our <abbr>HTML</abbr>, instead resorting to <abbr>CSS</abbr> class names. <abbr>HTML</abbr>5 hopes to solve that problem by introducing the <code>&#60;figure&#62;</code> and <code>&#60;figcaption&#62;</code> elements. Let's explore!</p>]]></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%2Fthe-figure-figcaption-elements%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>In traditional printed material like books and magazines, an image, chart, or code example would be accompanied by a caption. Before now, we didn&#8217;t have a way of semantically marking up this sort of content directly in our <abbr>HTML</abbr>, instead resorting to <abbr>CSS</abbr> class names. <abbr>HTML</abbr>5 hopes to solve that problem by introducing the <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code> elements. Let&#8217;s explore!</p>

<h2>The <code>&lt;figure&gt;</code> element</h2>

<p>The <code>&lt;figure&gt;</code> element is intended to be used in conjunction with the <code>&lt;figcaption&gt;</code> element to mark up diagrams, illustrations, photos, and code examples (among other things). The spec says this about <code>&lt;figure&gt;</code>:</p>

<blockquote><p>The figure element represents a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a single unit from the main flow of the document, and that can be moved away from the main flow of the document without affecting the document’s meaning.</p><footer><cite><a href="http://dev.w3.org/html5/markup/figure.html">W3C Specification</a></cite></footer></blockquote>

<h2>The <code>&lt;figcaption&gt;</code> element</h2>

<p>The <code>&lt;figcaption&gt;</code> element has been the <a href="http://adactio.com/journal/1604/">subject</a> of <a href="http://remysharp.com/2009/08/12/saving-figure-detail/">much</a> <a href="http://html5doctor.com/legend-not-such-a-legend-anymore/">debate</a>. The spec initially wanted to repurpose <code>&lt;legend&gt;</code> rather than introduce a new element. Other suggestions included <code>&lt;label&gt;</code>, <code>&lt;caption&gt;</code>, <code>&lt;p&gt;</code> or the <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code> elements. <a href="http://html5doctor.com/legend-not-such-a-legend-anymore/"><code>&lt;legend&gt;</code> was changed</a>, so we then used a combination of <code>&lt;dt&gt;</code> and <code>&lt;dd&gt;</code> inside <code>&lt;figure&gt;</code> at <a href="http://twitter.com/adactio">Jeremy&#8217;s</a> suggestion. Most of these suggestions failed since there was no backwards compatibility for styling with <abbr>CSS</abbr>.</p>

<p>Regular readers will know that <a href="http://html5doctor.com/summary-figcaption-element/">a new element was recently introduced</a>, namely <code>&lt;figcaption&gt;</code>. Who knows if it&#8217;ll stick, but for now here&#8217;s what the spec says about <code>&lt;figcaption&gt;</code>:</p>

<blockquote><p>The figcaption element represents a caption or legend for a figure.</p><footer><cite><a href="http://dev.w3.org/html5/markup/figcaption.html">W3C Specification</a></cite></footer></blockquote>

<p>The <code>&lt;figcaption&gt;</code> element is optional and can appear before <em>or</em> after the content within the <code>&lt;figure&gt;</code>. Only one <code>&lt;figcaption&gt;</code> element may be nested within a <code>&lt;figure&gt;</code>, although the <code>&lt;figure&gt;</code> element itself may contain multiple other child elements (e.g., <code>&lt;img&gt;</code> or <code>&lt;code&gt;</code>).</p>

<h2>Using <code>&lt;figure&gt;</code> and <code>&lt;figcaption&gt;</code></h2>

<p>So we&#8217;ve seen what the spec says about these elements. How do we use them? Let&#8217;s look at some examples.</p>

<h3>Figure with an image</h3>

<p>An image within a <code>&lt;figure&gt;</code> element without a caption:</p>

<figure><img src="http://html5doctor.com/wp-content/uploads/2010/03/orang-utan.jpg" alt="Baby Orang Utan hanging from a rope"></figure>

<p>Here&#8217;s the code for that:</p>

<pre><code>&lt;figure&gt;
  &lt;img src="/orang-utan.jpg" alt="Baby Orang Utan hanging from a rope"&gt;
&lt;/figure&gt;</code></pre>

<h3>Figure with an image and caption</h3>

<p>An image within a <code>&lt;figure&gt;</code> element with an explanatory caption:</p>

<figure><img src="http://html5doctor.com/wp-content/uploads/2010/03/macaque.jpg" alt="Macaque in the trees"><figcaption>A cheeky macaque, Lower Kintaganban River, Borneo. Original by <a href="http://www.flickr.com/photos/rclark/102352241/in/set-72057594082373448/">Richard Clark</a></figcaption>
</figure>

<p>and the code that we used:</p>

<pre><code>&lt;figure&gt;
  &lt;img src="/macaque.jpg" alt="Macaque in the trees"&gt;
  &lt;figcaption&gt;A cheeky macaque, Lower Kintaganban River, Borneo. Original by &lt;a href="http://www.flickr.com/photos/rclark/"&gt;Richard Clark&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>

<h3>A figure with multiple images</h3>

<p>Nesting multiple images within one <code>&lt;figure&gt;</code> element with a single caption:</p>

<figure class="trptych"><img src="http://html5doctor.com/wp-content/uploads/2010/03/kookaburra.jpg" alt="Kooaburra"><img src="http://html5doctor.com/wp-content/uploads/2010/03/pelican.jpg" alt="Pelican stood on the beach"><img src="http://html5doctor.com/wp-content/uploads/2010/03/lorikeet.jpg" alt="Cheeky looking Rainbow Lorikeet"><figcaption>Australian Birds. From left to right, Kookburra, Pelican and Rainbow Lorikeet.<br />Originals by <a href="http://www.flickr.com/photos/rclark/">Richard Clark</a></figcaption>
</figure>

<p>The code:</p>

<pre><code>&lt;figure&gt;
  &lt;img src="/kookaburra.jpg" alt="Kooaburra"&gt;
  &lt;img src="/pelican.jpg" alt="Pelican stood on the beach"&gt;
  &lt;img src="/lorikeet.jpg" alt="Cheeky looking Rainbow Lorikeet"&gt;
  &lt;figcaption&gt;Australian Birds. From left to right, Kookburra, Pelican and Rainbow Lorikeet. Originals by &lt;a href="http://www.flickr.com/photos/rclark/"&gt;Richard Clark&lt;/a&gt;&lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>

<h3>Figure with a code block</h3>

<p>The <code>&lt;figure&gt;</code> element may also be used for code examples:</p>

<figure><blockquote><p><code>&lt;small&gt;&lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution Share-alike license&lt;/a&gt;&lt;/small&gt;</code></p></blockquote>
<figcaption>Using <code>&lt;small&gt;</code> around a <a href="http://creativecommons.org/choose/" title="Choose a License">Creative Commons license</a> link with <code>rel="license"</code></figcaption></figure>

<p>Here&#8217;s the code for that:</p>

<pre><code>&lt;figure&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;code&gt;&amp;lt;small&amp;gt;&amp;lt;a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot;&amp;gt;Creative Commons Attribution Share-alike license&amp;lt;/a&amp;gt;&amp;lt;/small&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;figcaption&gt;Using &lt;code&gt;&amp;lt;small&amp;gt;&lt;/code&gt; around a &lt;a href="http://creativecommons.org/choose/" title="Choose a License"&gt;Creative Commons license&lt;/a&gt; link with &lt;code&gt;rel="license"&lt;/code&gt;&lt;/figcaption&gt;
&lt;/figure&gt;</code></pre>

<h3>Differences between <code>&lt;figure&gt;</code> and <code>&lt;aside&gt;</code></h3>

<p><a href="http://html5doctor.com/aside-revisited/">We covered <code>&lt;aside&gt;</code> in an earlier article</a>, but it is important to note the difference between the two. You should choose between <code>&lt;aside&gt;</code> or <code>&lt;figure&gt;</code> by asking yourself if the content is essential to understanding the section:</p>

<ul>
  <li>If the content is simply related and not essential, use <code>&lt;aside&gt;</code>.</li>
  <li>If the content is essential but its position in the flow of content isn’t important, use <code>&lt;figure&gt;</code>.</li>
</ul>

<p>Having said that, if its position relates to previous and subsequent content, use a more appropriate element — e.g., a <code>&lt;div&gt;</code>, a plain old <code>&lt;img&gt;</code>, a <code>&lt;blockquote&gt;</code>, or possibly even <code>&lt;canvas&gt;</code>, depending on its content.</p>

<h2>Don&#8217;t stop there!</h2>

<p>No need to constrain your <code>&lt;figure&gt;</code>s to images and code examples. Other content suitable for use in <code>&lt;figure&gt;</code> includes audio, video, charts (perhaps using <code>&lt;canvas&gt;</code> or <code>&lt;svg&gt;</code>), poems, or tables of statistics.</p>

<p>It may not always be appropriate to use the <code>&lt;figure&gt;</code> element, though. For example, a graphic banner should not be marked up with <code>&lt;figure&gt;</code>. Instead, simply use the <code>&lt;img&gt;</code> element.</p>

<h2>Summary</h2>

<p>As we&#8217;ve illustrated in this article, there are a lot of possibilities for the <code>&lt;figure&gt;</code> element. Just remember to make sure it&#8217;s the most appropriate element for the job. But you already do that for all your markup, right? <img src='http://html5doctor.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/small-hr-element/" rel="bookmark" class="crp_title">The small &amp; hr elements</a></li><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/summary-figcaption-element/" rel="bookmark" class="crp_title">Hello, summary and figcaption elements</a></li><li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</a></li><li><a href="http://html5doctor.com/september-html5-spec-changes/" rel="bookmark" class="crp_title">September HTML5 spec changes</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20figure%20%26%20figcaption%20elements%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;bodytext=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" 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%2Fthe-figure-figcaption-elements%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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements" 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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;notes=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" 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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements" 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%2Fthe-figure-figcaption-elements%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=The%20figure%20%26%20figcaption%20elements&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%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%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements" 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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;annotation=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" 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=The%20figure%20%26%20figcaption%20elements&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%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%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements" 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%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" 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%2Fthe-figure-figcaption-elements%2F&amp;h=The%20figure%20%26%20figcaption%20elements" 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%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements&amp;s=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" 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/the-figure-figcaption-elements/" rel="bookmark">The figure &#038; figcaption elements</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 13, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-figure-figcaption-elements/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #6</title>
		<link>http://html5doctor.com/your-questions-answered-6/</link>
		<comments>http://html5doctor.com/your-questions-answered-6/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 14:30:59 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[h1]]></category>
		<category><![CDATA[hcard]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1578</guid>
		<description><![CDATA[We're back with another round of patient questions about <abbr>HTML</abbr>5. In this article, we'll discuss using multiple <code>&#60;h1&#62;</code>s, audio codecs, microformats, post bylines, and the <code>&#60;time&#62;</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-answered-6%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%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 another round of patient questions about <abbr>HTML</abbr>5. In this article, we&#8217;ll discuss using multiple <code>&lt;h1&gt;</code>s, audio codecs, microformats, post bylines, and the <code>&lt;time&gt;</code> element.</p>
<h2>Using multiple <code>&lt;h1&gt;</code>s</h2>
<p>Bnonn asked:</p>
<blockquote><p>I&#8217;m unsure of how <code>h1</code> is supposed to be used now that pages can be divided into sections and articles. In (X)HTML4, a page was basically a page, and so you only had one <code>h1</code> element: the top level heading for the page. I&#8217;m not even sure if that was a requirement of HTML4, or if it was just a de facto standard, but it made sense.</p>
<p>Now, however, there are any number of possible sections and articles per page; each of which may contain any number of heading elements (and one of those might be inside a <code>header</code> element). Given that <code>h1</code> is a top-level heading, it seems as if each section and/or article should have one, in addition to the page-level <code>h1</code>. However, this contradicts what I know of accepted usage, so I&#8217;m confused about the way in which I should be marking up headings in HTML5. It doesn&#8217;t seem right to start headings in a <code>section</code>, for instance, with <code>h2</code>, because then&#8230;where&#8217;s the top-level heading for that element? But it doesn&#8217;t seem right to start them with <code>h1</code>, because that element in current web usage has more &#8220;power&#8221; than warrants its use there.</p>
<p>There is also SEO to wonder about. Even if using multiple <code>h1</code> elements is right, I wouldn&#8217;t want to be penalized for it by Google. So what&#8217;s the story with that?</p>
<p>Any help is much appreciated.</p>
<p>Regards,</p>
<p>Bnonn</p>
</blockquote>
<p>Basically, you can use multiple <code>&lt;h1&gt;</code>s in order to shape the document outline. So an <code>&lt;h1&gt;</code> within a <code>&lt;section&gt;</code> will be treated like an <code>&lt;h2&gt;</code> (if it is a nested <code>&lt;section&gt;</code>). If that <code>&lt;section&gt;</code> (and only that <code>&lt;section&gt;</code>) is aggregated elsewhere on the web, however, it will fit seamlessly into that external document&#8217;s outline. This means that your original <code>&lt;h1&gt;</code> could be treated as an <code>&lt;h1&gt;</code>, <code>&lt;h2&gt;</code>, <code>&lt;h3&gt;</code>, or <code>&lt;h4&gt;</code> as appropriate.</p>
<p>I hope that makes sense! Bruce&#8217;s article on <a href="http://html5doctor.com/the-section-element">the section element</a> touches on this, and we also hope to talk more about document outlines in the future.</p>
<p>Cheers,</p>
<p>Rich</p>
<p>P.S. Multiple <code>&lt;h1&gt;</code>s in <abbr>HTML</abbr>4 are perfectly legal, but seldom used.</p>
<h2>Audio Codecs</h2>
<p>Adam asked:</p>
<blockquote><p>Hello,</p>
<p>I&#8217;ve got a query about the issues regarding what codecs to use for the audio tag. I don&#8217;t quite get why Firefox won&#8217;t support mp3. Surely the browser calls on the codecs present on the operating system, not within the browser, so how are the licensing issues a problem to the browsers if they are simply leaving what is already present (and in theory already licensed)?</p>
<p>I fully admit that I am no lawyer. It just seems very odd the line of argument Mozilla has taken.</p>
<p>Adam Wilcox</p>
</blockquote>
<p>I&#8217;m not sure why they&#8217;ve taken that stance, but I know that Mozilla only plans to support Ogg and Apple are keen to push MP3 and MP4, so we&#8217;re at stalemate. Because of this, discussion of specific codecs has been removed from the spec altogether.</p>
<p>Although not related to audio, see this article I wrote about <a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/">YouTube and Vimeo supporting <abbr>HTML5</abbr> video</a>. It explains a little about codecs.</p>
<p>Sorry I can&#8217;t be of more help.</p>
<p>Rich</p>
<p><small>Since writing this reply there has been a lot more talk over codecs for both video and audio since Microsoft announced they would be supporting H.264 in <abbr>IE</abbr>9. We&#8217;ll cover this in more detail soon.</small></p>
<h2>hCards</h2>
<p>Ken asked:</p>
<blockquote><p>How does html 5 deal with hCards and microformats in general? Specifically, can you have more than one hCard per page? As I understand it currently, having more than one is problematic. I&#8217;m asking now because of the treatment &#8220;footer&#8221; and &#8220;aside&#8221; has gotten, i.e. they are context sensitive to their &#8220;article&#8221; or &#8220;section&#8221; unless top-level, then applied to the page. Also, the use of scoped on style tags: hCards should be updated in a like manner for html 5.</p>
<p>Thanks for hearing me out. I don&#8217;t know if this is the appropriate place for this question, but as html 5 is much more useful, I thought maybe a post is in order <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Also, &#8220;article&#8221;&#8217;s impact on the hAtom microformat makes for an interesting article, don&#8217;t ya think?</p>
</blockquote>
<p>We touched upon microformats in our articles on the <a href="http://html5doctor.com/the-address-element/"><code>&lt;address&gt;</code></a> and <a href="http://html5doctor.com/the-time-element/"><code>&lt;time&gt;</code></a> elements, but we&#8217;ll try to cover more soon (possibly in an article on the <code>&lt;article&gt;</code> element).</p>
<p>I haven&#8217;t heard that having more than one hCard is problematic. I&#8217;ve certainly never had any issues doing that. If you check out the source code on the homepage of HTML5Doctor, you&#8217;ll see we&#8217;ve used multiple hCards — one for each author&#8217;s name associated with a post.</p>
<p>Hope that helps a little.</p>
<p>Cheers,</p>
<p>Rich</p>
<h2>Article bylines</h2>
<p>Eric asked:</p>
<blockquote><p>I tweeted to you guys a few days ago (@ericdfields), wondering what you recommend for bylines for blog posts. Bylines, borrowing a newspaper term, would be the &#8216;Posted by SoandSo on Nov 1, 2010&#8242; copy you find under the article of your typical blog post.</p>
<p>To me, they seem like something of an &#8216;aside&#8217; for the header of the document.</p>
<p>I don&#8217;t know if its perfectly valid, but here&#8217;s the <a href="http://theeem.com/html5/test.html">test case I whipped up</a>.</p>
<p>Thanks in advance for any insight!</p>
</blockquote>
<p>In my opinion, they&#8217;re header or footer information, so I do:</p>
<pre><code>&lt;header&gt;
  &lt;hgroup&gt;
    &lt;h1&gt;Foo&lt;/h1&gt;
    &lt;h2&gt;Bar&lt;/h2&gt;
  &lt;/hgroup&gt;
  &lt;p&gt;Posted by Bruce on &lt;time datetime="2009-11-01"&gt;1st November&lt;/time>&lt;/p&gt;
&lt;/header&gt;</code></pre>
<p>Thanks, Bruce</p>
<h2>How to use <code>&lt;time&gt;</code> with a date in astrology</h2>
<blockquote><p>Dear HTML5Doctors,</p>
<p>I was confused in how to using the <code>time</code> tag with the Astrology date. For example if I have a chunk of content like this:</p>
<p>ARIES: 13 Apr &#8211; 14 May</p>
<p>how can I use attribute &#8220;datetime&#8221; to explain the format of that date?</p>
<pre><code>&lt;p&gt;ARIES: &lt;time title="start" datetime="???"&gt;13 Apr&lt;/time&gt; - &lt;time title="end" datetime="???"&gt;14 May&lt;/time&gt;&lt;/p&gt;</code></pre>
<p>The year of birth is not fixed, please advice me some solutions about this.</p>
<p>Thank you,</p>
<p>radiz</p>
</blockquote>
<p>Hi Radiz,</p>
<p>The time element is for one specific day, not a range or &#8220;imprecise&#8221; date. So you can&#8217;t use it for &#8220;13 April.&#8221; You need to use it for a specific &#8220;13 April&#8221; and give a year. For more, see our article on <a href="http://html5doctor.com/the-time-element/">the <code>&lt;time&gt;</code> element</a>.</p>
<p>Thanks, Bruce</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 <abbr>HTML</abbr>5 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-7/" rel="bookmark" class="crp_title">Your Questions Answered #7</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-9/" rel="bookmark" class="crp_title">Your Questions Answered 9</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-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%236%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;bodytext=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." 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-answered-6%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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236" 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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;notes=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." 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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236" 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-answered-6%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%236&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%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-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236" 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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;annotation=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." 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%236&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-6%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-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236" 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-answered-6%2F&amp;title=Your%20Questions%20Answered%20%236&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." 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-answered-6%2F&amp;h=Your%20Questions%20Answered%20%236" 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-answered-6%2F&amp;t=Your%20Questions%20Answered%20%236&amp;s=We%27re%20back%20with%20another%20round%20of%20patient%20questions%20about%20HTML5.%20In%20this%20article%2C%20we%27ll%20discuss%20using%20multiple%20%26lt%3Bh1%26gt%3Bs%2C%20audio%20codecs%2C%20microformats%2C%20post%20bylines%2C%20and%20the%20%26lt%3Btime%26gt%3B%20element." 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-answered-6/" rel="bookmark">Your Questions Answered #6</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 8, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
