<?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; Browser Compatibility</title>
	<atom:link href="http://html5doctor.com/category/browser-compatibility/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>YouTube and Vimeo support HTML5 Video</title>
		<link>http://html5doctor.com/youtube-and-vimeo-support-html5-video/</link>
		<comments>http://html5doctor.com/youtube-and-vimeo-support-html5-video/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 16:08:28 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[vimeo]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1315</guid>
		<description><![CDATA[Unless you've been hiding under an <abbr>XHTML</abbr>2 shaped rock for the past week or so you'll know that both YouTube and Vimeo have announced plans to support the <abbr>HTML</abbr>5 video 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%2Fyoutube-and-vimeo-support-html5-video%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyoutube-and-vimeo-support-html5-video%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Unless you&#8217;ve been hiding under an <abbr>XHTML</abbr>2 shaped rock for the past week or so, you&#8217;ll know that both YouTube and Vimeo have announced plans to support the <abbr>HTML</abbr>5 video element. Two <a href="http://youtube-global.blogspot.com/2010/01/introducing-youtube-html5-supported.html" title="Introducing YouTube HTML5 Supported Videos">blog</a> <a href="http://www.vimeo.com/blog:268" title="Try our new HTML5 player! on Vimeo Staff Blog">posts</a> published last week announced that the two major players in online video are experimenting with the <abbr>HTML</abbr>5 <a href="http://html5doctor.com/the-video-element/"><code>&lt;video&gt;</code> element</a>.</p>
<p><img src="http://html5doctor.com/wp-content/uploads/2010/01/yt-vimeo.jpg" alt="YouTube and Vimeo Logos" /></p>
<h2>Will it work cross browser?</h2>
<p>The videos will work natively in Safari and Chrome (well, YouTube would certainly have to, wouldn&#8217;t it?). They&#8217;ll also work in <abbr>IE</abbr> if you have <a href="http://code.google.com/chrome/chromeframe/">ChromeFrame</a> installed (which we all know is cheating). If you&#8217;re using a browser that doesn&#8217;t support <abbr>HTML</abbr>5 video it will default back to the Flash method they currently employ.</p>
<p>Both YouTube and Vimeo use the H.264 codec to encode the videos &mdash; and that&#8217;s where things start to get complicated.</p>
<p>Since no official codec is defined in the spec <ins>because</ins> browser manufacturers have chosen to use different codecs to render <abbr>HTML</abbr>5 video. Opera and Mozilla use the Ogg Theora codec (more on that later), while Apple and Google use H.264. Who knows which side of the fence Microsoft will come down on, but I feel duty bound to mention that the licensors of the H.264 codec include both <a href="http://www.mpegla.com/main/programs/AVC/Pages/Licensors.aspx">Microsoft and Apple</a>.</p>
<h2>The elephant in the room</h2>
<p>There&#8217;s one major problem here: Ogg Theora, the open source video codec supported by both Firefox and Opera, is not supported on either site. It&#8217;s a shame these browsers aren&#8217;t supported, especially since <a href="http://blog.mozilla.com/blog/2010/01/21/firefox-3-6-release/">Firefox 3.6 was released last week</a> and announced support for full-screen video in its native video player.</p>
<h3>Why use Ogg?</h3>
<p>As previously stated, Ogg is an open source codec, meaning it&#8217;s free to use and implement. By contrast, support for native H.264 decoding in a browser costs approximately &#036;5 million per year. (See <a href="http://www.mpegla.com/main/programs/avc/Documents/AVC_TermsSummary.pdf"><cite>summary of AVC/H.264 license terms [PDF]</cite></a>.) It also seems that people creating H.264 content will be liable for royalties starting in 2011.</p>
<p>Far be it from me to get into the ins and outs of the debate over which codec to use, but it seems that open source would be the better way to go. Silivia Pfeiffer (a contractor for Mozilla) <a href="http://blog.gingertech.net/2010/01/25/html5-video-25-h-264-reach-vs-95-ogg-theora-reach/">claims</a> that serving as Ogg Theora will reach more people than serving as H264.</p>
<p>Google, on the other hand, which owns YouTube has said that Theora is not a good enough codec, claiming &#8220;If [youtube] were to switch to theora and maintain even a semblance of the current youtube quality it would take up most available bandwidth across the Internet&#8221;, a claim hotly (and convincingly) contested in Greg Maxwell&#8217;s <a href="http://people.xiph.org/~greg/video/ytcompare/comparison.html">YouTube / Ogg/Theora comparison</a>.</p>
<p>YouTube and Vimeo seem to have discounted Ogg. I&#8217;d love to find out if there are other plans to add support for Firefox and Opera.</p>
<h2>Where does that leave us?</h2>
<p>Ignoring the whole video codec debate, it leaves us in some ways back where we started &mdash; dealing with proprietary software or complicated licensing to create online content rather than using technologies that will allow us to have a truly open web.</p>
<p>With Apple, Google, Mozilla, and Opera not likely to budge on their respective codec choices for <abbr>HTML</abbr>5 video, we can only hope that the developers at market-leading sites like YouTube and Vimeo can implement cross-browser interoperable video just like Kroc Camen&#8217;s <a href="http://camendesign.com/code/video_for_everybody">Video for Everybody</a>. Judging by the aforementioned blog posts, both sites have more plans in the pipeline, which is encouraging.</p>
<p>The codec battles are only beginning, and we&#8217;re waiting to see which direction one big gun will point. Last year, Google (which owns YouTube) <a href="http://googleblog.blogspot.com/2009/08/innovation-in-video-on-web.html">announced</a> that is paying $104million for a company called On2 Technologies, &#8220;a leading creator of high-quality video compression technology&#8221; and which made the original <a href="http://en.wikipedia.org/wiki/VP3#History">VP3 codec</a> which is the basis for Ogg Theora.</p>
<p>What are their plans? To release a &#8220;better&#8221; Theora-like codec into the community? We can only speculate.</p>
<p>Back to today. Although not perfect, these sites&#8217; support for the <code>&lt;video&gt;</code> element is still a massive leap forward for <abbr>HTML</abbr>5. Who knows &mdash; if more large sites continue to adopt <abbr>HTML</abbr>5, maybe it&#8217;ll be ready in 2010 rather than 2022!</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<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>
<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/native-audio-in-the-browser/" rel="bookmark" class="crp_title">Native Audio in the browser</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-2/" rel="bookmark" class="crp_title">Your questions answered #2</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=YouTube%20and%20Vimeo%20support%20HTML5%20Video%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyoutube-and-vimeo-support-html5-video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;bodytext=Unless%20you%27ve%20been%20hiding%20under%20an%20XHTML2%20shaped%20rock%20for%20the%20past%20week%20or%20so%20you%27ll%20know%20that%20both%20YouTube%20and%20Vimeo%20have%20announced%20plans%20to%20support%20the%20HTML5%20video%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%2Fyoutube-and-vimeo-support-html5-video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video" 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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;notes=Unless%20you%27ve%20been%20hiding%20under%20an%20XHTML2%20shaped%20rock%20for%20the%20past%20week%20or%20so%20you%27ll%20know%20that%20both%20YouTube%20and%20Vimeo%20have%20announced%20plans%20to%20support%20the%20HTML5%20video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video" 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%2Fyoutube-and-vimeo-support-html5-video%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=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyoutube-and-vimeo-support-html5-video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;t=YouTube%20and%20Vimeo%20support%20HTML5%20Video" 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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;annotation=Unless%20you%27ve%20been%20hiding%20under%20an%20XHTML2%20shaped%20rock%20for%20the%20past%20week%20or%20so%20you%27ll%20know%20that%20both%20YouTube%20and%20Vimeo%20have%20announced%20plans%20to%20support%20the%20HTML5%20video%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=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyoutube-and-vimeo-support-html5-video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;t=YouTube%20and%20Vimeo%20support%20HTML5%20Video" 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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;title=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Unless%20you%27ve%20been%20hiding%20under%20an%20XHTML2%20shaped%20rock%20for%20the%20past%20week%20or%20so%20you%27ll%20know%20that%20both%20YouTube%20and%20Vimeo%20have%20announced%20plans%20to%20support%20the%20HTML5%20video%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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;h=YouTube%20and%20Vimeo%20support%20HTML5%20Video" 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%2Fyoutube-and-vimeo-support-html5-video%2F&amp;t=YouTube%20and%20Vimeo%20support%20HTML5%20Video&amp;s=Unless%20you%27ve%20been%20hiding%20under%20an%20XHTML2%20shaped%20rock%20for%20the%20past%20week%20or%20so%20you%27ll%20know%20that%20both%20YouTube%20and%20Vimeo%20have%20announced%20plans%20to%20support%20the%20HTML5%20video%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/youtube-and-vimeo-support-html5-video/" rel="bookmark">YouTube and Vimeo support HTML5 Video</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on January 23, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/youtube-and-vimeo-support-html5-video/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #4</title>
		<link>http://html5doctor.com/your-questions-answered-4/</link>
		<comments>http://html5doctor.com/your-questions-answered-4/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 08:52:14 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[WAI-ARIA]]></category>
		<category><![CDATA[aria]]></category>
		<category><![CDATA[details]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[xhtml5]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1242</guid>
		<description><![CDATA[
			
				
			
		
 Here we go with another post rounding up your HTML5 questions and sharing the answers with the world. We cover a wide range of topics this time, inlcluding ARIA, storage, offline capabilities, and document outlines, so read on to find the answers.
We also want to know what areas of HTML5 you&#8217;d like us to [...]]]></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-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-4%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="Illustration of a doctor treating a patient" class="alignright size-full wp-image-424" /> Here we go with another post rounding up your <abbr>HTML</abbr>5 questions and sharing the answers with the world. We cover a wide range of topics this time, inlcluding <abbr>ARIA</abbr>, storage, offline capabilities, and document outlines, so read on to find the answers.</p>
<p>We also want to know what areas of <abbr>HTML</abbr>5 you&#8217;d like us to cover in future articles, so <a href="/contact/">let us know</a>!</p>
<h2>Older browsers and <abbr>XHTML</abbr></h2>
<p>Brett Prichard asked:</p>
<blockquote><p>If I were to use one of the new tags in <abbr>HTML</abbr>5, (i.e., <code>&lt;video&gt;</code> or <code>&lt;header&gt;</code>) what would happen when the page is rendered by an older browser?</p>
<p>The other question I have is will there be an <abbr>XHTML</abbr> equivalent? <abbr>XHTML</abbr> 2.0 breaks off compatibility with <abbr>HTML</abbr>s 1-4, but will it be compatible with <abbr>HTML</abbr>5? I prefer to code in <abbr>XHTML</abbr>.</p>
<p>Thank you for reading.</p></blockquote>
<p>To answer your first question: nothing special. The content nested within the element is displayed. (In the case of video, the fallback content is shown.)</p>
<p>Regarding your second question, I wrote about the <a href="/html-5-xml-xhtml-5/"><abbr>XHTML</abbr> serialisation of <abbr>HTML</abbr>5 a while ago</a>.</p>
<p>&mdash; Thanks, Bruce</p>
<h2><abbr>ARIA</abbr></h2>
<p>Joseph Chapman asked:</p>
<blockquote><p>My colleagues and I wish to switch our doctype to the streamlined <code>&lt;!doctype html&gt;</code> and implement several things we learnt from Jeremy Keith last Wednesday, primarily <abbr title="Accessible Rich Internet Applications">ARIA</abbr>. </p>
<p>We know that support is good as long as we add an extra DTD, but we can&#8217;t find the appropriate doctype declaration to stick on the end of <code>...html&gt;</code> Any ideas? We are really keen to kick this off and use a new piece of technology that will help springboard our site to a new level of accessibility. </p>
<p>Any answers appreciated.</p>
<p>Thanks for your help.</p></blockquote>
<p>It&#8217;s okay to add <abbr>ARIA</abbr> to <abbr>HTML</abbr>5 now without using a different doctype. I suggest you give <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/content-models.html#annotations-for-assistive-technology-products-(aria)">this part of the spec</a> a read.</p>
<p>I believe a task force has been created to more closely align <abbr>ARIA</abbr> to <abbr>HTML</abbr>5. We plan to cover <abbr>ARIA</abbr> more in a future post.</p>
<p>Hope this helps</p>
<p>&mdash; Rich </p>
<h2>Attribute Minification</h2>
<p>Nick Leon asked:</p>
<blockquote><p>Hey there HTML5Doctor,</p>
<p>I consider myself a strong <abbr title="Plain Old Semantic HTML">POSH</abbr> developer. One of the requirements for valid <abbr>XHTML</abbr> is that &#8220;attribute minimization&#8221; is not allowed. <abbr>HTML</abbr> permits &#8220;attribute minimization&#8221;, where boolean attributes can have their value omitted entirely, e.g., <code>&lt;option selected&gt;</code>. All XML attributes must have explicit quoted values, so in XML this would be written as <code>&lt;option selected="selected"&gt;</code>.</p>
<p>I was wondering where <abbr>HTML</abbr>5 stands with attribute minimization. I noticed in some of your example code, you provided the minimized form of the attribute, e.g., <code>&lt;audio src="elvis.ogg" controls autobuffer&gt;&lt;/audio&gt;</code>. Is this valid in <abbr>HTML</abbr>5? Would this be the valid version for <abbr>XHTML</abbr>5:</p>
<p><code>&lt;audio src="elvis.ogg" controls="1" autobuffer="0"&gt;&lt;/audio&gt;</code>?</p></blockquote>
<p>Those are both valid <abbr>HTML</abbr>5 structures (however,  controls=&#8221;1&#8243; isn&#8217;t legal; you need to say controls=&#8221;controls&#8221;).</p>
<p>In <abbr>HTML</abbr>5, you can format attributes as you please. In <a href="/html-5-xml-xhtml-5/"><abbr>XHTML</abbr>5 (the <abbr>XML</abbr> serialisation)</a>, you need to obey the <abbr>XML</abbr> rules.</p>
<p>&mdash; Cheers, Bruce</p>
<h2>Offline storage</h2>
<p>Kevin Searle asked:</p>
<blockquote><p>I&#8217;m having a hard time wrapping my head around the offline storage capabilities of the <abbr>HTML</abbr> 5 spec. Can you consider an &#8220;<abbr>HTML</abbr> 5 Offline Storage 101&#8243; article?</p></blockquote>
<p>Just to clarify, do you mean &#8220;storage&#8221; or &#8220;offline&#8221;? They&#8217;re two very different things.</p>
<p>Storage relates to variables, like cookie jars but a lot bigger.</p>
<p>Offline applications are about detecting connectivity and possibly running your app without a connection to the Web.</p>
<p>We (i.e., Remy) will be writing about both of these topics, but it&#8217;s useful to know which is more in demand than the other.</p>
<p>In the meantime, feel free to check out the demos I&#8217;ve written at <a href="http://html5demos.com"><abbr>HTML</abbr>5 Demos</a> (covering offline, storage, and web databases).</p>
<p>&mdash; Remy</p>
<h2>Nav Title (in the document outline)</h2>
<p>D Ross asked:</p>
<blockquote><p>Working on my new site and checked it with the <a href="http://gsnedders.html5.org/outliner/">outliner</a>. I&#8217;m getting an &#8220;untitled section&#8221; showing up because I don&#8217;t have a headline inside my &#8220;nav&#8221; element.</p>
<p>Is this correct? Do I really need to title my main nav?</p>
<p>If so, is adding an <code>&lt;h5&gt;</code> or something similar with the words &#8220;main navigation&#8221; good enough? If so, is hiding it with <code>display: none</code> okay?</p>
<p>Thanks,</p>
<p>DRoss</p></blockquote>
<p>Yes, &#8220;untitled section&#8221; is fine. I know it&#8217;s been suggested to the developer of the outliner that it should say &#8220;navigation&#8221; or something similar, but I&#8217;m not sure when or whether that will happen. (You&#8217;ll see the same thing with <code>&lt;aside&gt;</code> too if there&#8217;s no heading nested directly beneath the element).</p>
<p>Thanks,</p>
<p>&mdash; Rich</p>
<h2>The details element</h2>
<p>Bart asked:</p>
<blockquote><p>Hello Doctors!</p>
<p>I&#8217;d like to ask you a little help with understanding the &#8220;details&#8221; element.</p>
<p>As the W3 spec says: &#8220;The details element represents a disclosure widget from which the user can obtain additional information or controls&#8221;.</p>
<p>I&#8217;m not sure if I get it right, but I think I can use this element to put details about a post (such as date and time) and controls, including &#8220;answer&#8221;, &#8220;save&#8221; and &#8220;repost&#8221;.</p>
<p>Please tell me if I&#8217;m wrong.</p>
<p>Regards, Bart</p>
<p>PS. I love the HTML5doctor blog, it&#8217;s so important to explain how to use <abbr>HTML</abbr>5. Keep up the great work!</p></blockquote>
<p>This question triggered a flurry of responses from several of us doctors, so we&#8217;ve added them all here for you.</p>
<h3>Answer 1</h3>
<p>The spec says <code>&lt;details&gt;</code> is not appropriate for footnotes, and you could argue that post details are footnotes. Also, the <code>&lt;details&gt;</code> element has the option to show or hide its content, which suggests to me that it&#8217;s not appropriate for the post details.</p>
<p>You could possibly use a <code>&lt;section&gt;</code> or a <code>&lt;footer&gt;</code> for the post details, but I&#8217;m not clear on what you mean by &#8220;controls&#8221;. </p>
<p>For the date/time, you can use the <code>&lt;time&gt;</code> element:</p>
<pre><code>&lt;time class="published updated" datetime="2009-09-23"&gt;September 23rd, 2009&lt;/time&gt;</code></pre>
<p>Other doctors might have other opinions, but I hope this helps.</p>
<p>&mdash; Tom</p>
<h3>Answer 2</h3>
<p>Just to follow up on Tom&#8217;s reply: the user viewing your content can <em>control</em> whether or not they see the details.</p>
<p>The <code>&lt;details&gt;</code> element is an interactive element that is collapsed by default, so that only the heading is visible. The heading should be marked up in a <code>&lt;dt&gt;</code> element (if absent, it will read &#8220;Details&#8221;).</p>
<p>The control that the user agent should render (when fully supporting the <code>&lt;details&gt;</code> element) is a small triangular button to the left that, when clicked, toggles the visibility of the element&#8217;s contents.</p>
<p>If the <code>&lt;details&gt;</code> element should be open by default, it should have its <code>open</code> attribute set.</p>
<p>I would use <code>&lt;details&gt;</code> for any content that still allows the surrounding content to make sense while not necessarily needing to be seen. So in your example, I would put the metadata in the <code>&lt;details&gt;</code>, but not the &#8220;user controls&#8221; to reply, save, etc., since the user should always be able to see that they can perform these actions.</p>
<p>While the browser vendors haven&#8217;t implemented the interactive aspect of details, I, for one, will be emulating this using JavaScript.</p>
<p>I hope that helps (too!).</p>
<p>&mdash; Remy</p>
<h3>Answer 3</h3>
<p>You can also use <code>pubdate</code> as an attribute of <code>&lt;time&gt;</code>:</p>
<pre><code>&lt;time pubdate datetime="2009-09-23"&gt;September 23rd, 2009&lt;/time&gt;</code></pre>
<p><code>pubdate</code> is useful when you have two different times in the post. For example, for a future event:</p>
<pre><code>&lt;article&gt;
&lt;header&gt;
&lt;h1&gt;Gig: Hixie and the Pixies, &lt;time datetime="2010-01-01"&gt;Jan 1st 2010&lt;/time&gt;, Royal Albert Hall&lt;/h1&gt;
&lt;p>Published &lt;time datetime="2009-09-21" pubdate&gt;Sept 21, 2009&lt;/time&gt;&lt;/p&gt;
&lt;/header&gt;
&lt;p&gt;With Lachy on kazoo, Henri on Sousaphone, Pilgers on the triangle, and Hixie conducting&lt;/p&gt;
&lt;/article&gt;</code></pre>
<p>I feel a post about the <code>&lt;time&gt;</code> element coming on&hellip;</p>
<p>&mdash; Bruce</p>
<h2>More to come</h2>
<p>That wraps up this round of questions! We&#8217;d like to know what areas of <abbr>HTML</abbr>5 you&#8217;d like us to cover in future articles, so leave a comment below or <a href="http://html5doctor/contact/">send us an e-mail</a>.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/your-questions-answered-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li>
<li><a href="http://html5doctor.com/your-questions-answered-3/" rel="bookmark" class="crp_title">Your Questions Answered #3</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>
<li><a href="http://html5doctor.com/absent-elements-and-validation/" rel="bookmark" class="crp_title">Absent Elements and Validation</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Your%20Questions%20Answered%20%234%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-4%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-4%2F&amp;title=Your%20Questions%20Answered%20%234&amp;bodytext=%20Here%20we%20go%20with%20another%20post%20rounding%20up%20your%20HTML5%20questions%20and%20sharing%20the%20answers%20with%20the%20world.%20We%20cover%20a%20wide%20range%20of%20topics%20this%20time%2C%20inlcluding%20ARIA%2C%20storage%2C%20offline%20capabilities%2C%20and%20document%20outlines%2C%20so%20read%20on%20to%20find%20the%20answers.%0D%0A" 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-4%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-4%2F&amp;title=Your%20Questions%20Answered%20%234" 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-4%2F&amp;title=Your%20Questions%20Answered%20%234&amp;notes=%20Here%20we%20go%20with%20another%20post%20rounding%20up%20your%20HTML5%20questions%20and%20sharing%20the%20answers%20with%20the%20world.%20We%20cover%20a%20wide%20range%20of%20topics%20this%20time%2C%20inlcluding%20ARIA%2C%20storage%2C%20offline%20capabilities%2C%20and%20document%20outlines%2C%20so%20read%20on%20to%20find%20the%20answers.%0D%0A" 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-4%2F&amp;title=Your%20Questions%20Answered%20%234" 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-4%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%234&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-4%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-4%2F&amp;t=Your%20Questions%20Answered%20%234" 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-4%2F&amp;title=Your%20Questions%20Answered%20%234&amp;annotation=%20Here%20we%20go%20with%20another%20post%20rounding%20up%20your%20HTML5%20questions%20and%20sharing%20the%20answers%20with%20the%20world.%20We%20cover%20a%20wide%20range%20of%20topics%20this%20time%2C%20inlcluding%20ARIA%2C%20storage%2C%20offline%20capabilities%2C%20and%20document%20outlines%2C%20so%20read%20on%20to%20find%20the%20answers.%0D%0A" 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%234&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-4%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-4%2F&amp;t=Your%20Questions%20Answered%20%234" 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-4%2F&amp;title=Your%20Questions%20Answered%20%234&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=%20Here%20we%20go%20with%20another%20post%20rounding%20up%20your%20HTML5%20questions%20and%20sharing%20the%20answers%20with%20the%20world.%20We%20cover%20a%20wide%20range%20of%20topics%20this%20time%2C%20inlcluding%20ARIA%2C%20storage%2C%20offline%20capabilities%2C%20and%20document%20outlines%2C%20so%20read%20on%20to%20find%20the%20answers.%0D%0A" 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-4%2F&amp;h=Your%20Questions%20Answered%20%234" 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-4%2F&amp;t=Your%20Questions%20Answered%20%234&amp;s=%20Here%20we%20go%20with%20another%20post%20rounding%20up%20your%20HTML5%20questions%20and%20sharing%20the%20answers%20with%20the%20world.%20We%20cover%20a%20wide%20range%20of%20topics%20this%20time%2C%20inlcluding%20ARIA%2C%20storage%2C%20offline%20capabilities%2C%20and%20document%20outlines%2C%20so%20read%20on%20to%20find%20the%20answers.%0D%0A" 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-4/" rel="bookmark">Your Questions Answered #4</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on December 9, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Your Questions Answered #3</title>
		<link>http://html5doctor.com/your-questions-answered-3/</link>
		<comments>http://html5doctor.com/your-questions-answered-3/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 13:52:44 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Boilerplates]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Validation]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[outline]]></category>
		<category><![CDATA[xmls]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1061</guid>
		<description><![CDATA[We're back with our (semi) regular round up of answering readers HTML5 related questions. Right, let's not mess about any longer and dive straight in with the questions.]]></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-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-3%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>We&#8217;re back with our (semi) regular round up of answering readers <abbr>HTML</abbr>5 related questions. Right, let&#8217;s not mess about any longer and dive straight in with the questions.</p>
<h2>Multiple use of tags</h2>
<p>Daniel Davis asked:</p>
<blockquote><p>Dear Doctor,</p>
<p>Just a quick confirmation please.</p>
<p>Am I right in thinking that nav, like header and footer, can be used more than once in a single page?  For example, surrounding a menu at the top of the page and surrounding next/previous buttons at the bottom.<br />
Come to think of it, is it fair to say that all tags except html, head and body can be used more than once?<br />
Thanks in advance, doctor.</p>
<p>I&#8217;ll be back soon about my dodgy knee.</p></blockquote>
<p>You&#8217;re correct all the elements you mention can be used more than once a page. If you see this article <a href="/the-header-element/">about the header</a> and this about <a href="/the-footer-element/">the footer</a> &#8211; they show that you can use them multiple times on a page. Also you don&#8217;t really need html, head or body tags, as all browsers will assume them anyway but it&#8217;s also safe to leave them included.</p>
<p>&mdash; Hope that clears things up <a href="/author/richc/">Rich</a> and <a href="/author/brucel/">Bruce</a></p>
<h2><abbr>HTML</abbr>5 + Javascript Client Web App</h2>
<p>Girish asked:</p>
<blockquote><p>Is it possible to create a complete client side application using HTML 5 (it will embed chat clients, stock ticker) + JavaScript, and then bundle is with underlining Firefox 3.5 engine, so that user can install it as a desktop app on Linux, and then it runs in its own window using firefox 3.5 engine. The app will store everything in local storage &#8211; like url, usernames etc, and will not interact with any local server.</p>
<p>It would pure <abbr>HTML</abbr>5 + JavaScript based client web app which would be packaged, and can be installed or launched from startup scripts.</p>
<p>Or instead of using firefox 3.5 engine, we can use Mozilla Prism to convert it to web app, and then bundle it, is it possible?</p></blockquote>
<p>Technically it <em>should</em> be possible. Certainly the <abbr>HTML</abbr>5 <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html#offline">offline applications API</a> (via the manifest) gives you all that ability to create a client side app and it run locally without a web connection.</p>
<p>However, the browser is the problem.  <a href="http://prism.mozilla.com/">Prism</a> might be a good way to deploy this as a standalone app, but I don&#8217;t know if Prism is running the latest Gecko engine (or whether that comes with the JS engine, etc) &#8211; and even if it does &#8211; Firefox 3.5 currently has a pretty severe bug with the offline applications: it doesn&#8217;t work!</p>
<p>I have logged the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=501422">bug with Mozilla</a> and I know they&#8217;re working (in fact, I believe they&#8217;ve fixed it and are now testing).</p>
<p>The alternative is to use <a href="http://fluidapp.com/">Fluid</a> (a Webkit based app) &#8211; but again, that&#8217;s only if they have updated to the latest Webkit and thus including the offline applications API (that said, quickly looking at the Fluid site, their in-progress version may have the latest Webkit).</p>
<p>Regarding launch from start up scripts &#8211; you could achieve this though the custom scheme handlers (but this is just Firefox IIRC): <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#custom-handlers">http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#custom-handlers</a></p>
<p>Equally, there may be an API that you could exploit via the standalone browser, either Prism or Fluid.</p>
<p>&mdash; Good luck! <a href="http://html5doctor.com/author/remys/">Remy</a></p>
<h2>MIME or DOCTYPE, which one prevails</h2>
<p>Pedro Estébanez asked:</p>
<blockquote><p>Hello doctor,</p>
<p>I have found this site a very good resource for web developers and I thank you for your effort.</p>
<p>Now, my question:</p>
<p>There is a lot of discussion about hot to tell the browser we are using <abbr>HTML</abbr>5 or X<abbr>HTML</abbr>5 by setting the Content-Type HTTP header. But then I don&#8217;t know the true role the DOCTYPE plays (apart from keeping quirks mode from being activated and validation).</p>
<p>For example, if I compose my documents as XHTML with an according DOCTYPE and my server serves them as text/html, why XML mode is not triggered in the browser?</p>
<p>Thanks in advance.</p></blockquote>
<p>Did you see this article on the site from Bruce? <a href="/html-5-xml-xhtml-5/"><abbr>HTML</abbr>5, XML and X<abbr>HTML</abbr>5</a> and this one from Remy <a href="/html-5-boilerplates/"><abbr>HTML</abbr>5 Boilerplates</a>.</p>
<p>Also see this (linked in Bruce&#8217;s article) for some advice on using the right mime type. <a href="http://www.webstandards.org/learn/articles/askw3c/sep2003/">http://www.webstandards.org/learn/articles/askw3c/sep2003/</a>.</p>
<p>&mdash; Cheers <a href="/author/richc/">Rich</a></p>
<h2>Outline Algorithm</h2>
<p>Mike Taylor asked:</p>
<blockquote><p>In Section 4.4.11.1 of the current <abbr>HTML</abbr>5 spec, the outline algorithm is described&#8211;yet it&#8217;s not super clear in what ways this is useful to users or developers. It would be great if some more light could be shed on the topic!</p>
<p>Thanks for the awesome blog, btw.</p></blockquote>
<p>The outliner basically allows you to easily see the heading structure of a site. The outline can then figure out from the heading structure where in the outline it should sit, should you want to only parse a section of the code into another site or page for example. (I realise this isn&#8217;t totally clear). Also check out the <a href="http://gsnedders.html5.org/outliner/"><abbr>HTML</abbr>5 Outliner</a> for checking your work.</p>
<p>Bruce covered it a little bit in his <a href="/the-section-element/">section article</a> &#8211; <q>&#8220;With very few exceptions, section should not be used if there is no natural heading for it. Check your work in the HTML 5 outiner tool. If you see any instances of “untitled section” that corresponds to a section, you’re probably doing it wrong. (It’s fine for a nav or aside element to be untitled, however).&#8221;</q></p>
<p>We&#8217;ll try and cover it in more detail in a future post but I hope this helps for now, <a href="/author/richc/">Rich</a>.</p>
<h2><abbr>HTML</abbr>5 and xmlns</h2>
<p>Ad Taylor asked:</p>
<blockquote><p>
I hope this isn&#8217;t a stupid question BUT …</p>
<p>If I am using the html5 DOCTYPE and I am still using xhtml syntax do I need to define the xmlns in the html tag (i.e. xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;)?</p>
<p>Thank you for taking the time to do this.</p></blockquote>
<p>We said, Not a stupid question, but a simple answer: No!</p>
<p>&mdash; Ta <a href="http://html5doctor.com/author/brucel/">Bruce</a> (HTML5 Shrink)</p>
<h2>Developing to a changing spec</h2>
<p>Sam Rayner asked:</p>
<blockquote><p>I read the Super Friends Guide to <abbr>HTML</abbr>5 Hiccups &#8211; http://www.zeldman.com/superfriends/guide/ and it&#8217;s worried me a little.</p>
<p>I&#8217;ve recently been developing personal projects using <abbr>HTML</abbr>5 as I find I learn best &#8216;on the job&#8217; and wish to become familiar with the new spec by putting it in to practice. However, it sounds like I&#8217;ve misinterpreted bits and often used new elements such as footer in the way the Super Friends describe rather than in line with the spec.</p>
<p>I really want to continue enjoying the benefits of <abbr>HTML</abbr>5 in my own non-critical web work but it seems I run the risk of having to return to it all at a later date and amend stuff due to changes in the spec.</p>
<p>What do you think the best course of action is? Continue with 5 but keep going back and fixing old projects? &#8211; Could become a real hassle.</p>
<p>Continue with 5 and leave non-visual discrepancies as they are (the code may be slightly off but it&#8217;s styled fine)? &#8211; Goes against all of my natural instincts to do things right.</p>
<p>Return to 4 and use class names as apposed to the new elements for the time being?</p>
<p>I realise this is the risk I take developing with a developing spec but I&#8217;m worried if I wait until everything is set in stone I&#8217;ll still be using HTML4 years from now!</p>
<p>Thanks a lot,</p></blockquote>
<p>I understand your concerns with the spec changing from day to day. It&#8217;s hard to keep up with (there&#8217;s 6 of us and that&#8217;s tough enough).</p>
<p>Although I&#8217;m sure you&#8217;re aware in footers case, its <a href="/the-footer-element-update/">content model has now been changed</a> to allow it to act more like header.</p>
<p>I think essentially you have three choices for your development or a combination of the below currently:</p>
<ol>
<li>Continue working as you are with new <abbr>HTML</abbr>5 elements and change them as the spec becomes more defined</li>
<li>Use HTML4, with <abbr>HTML</abbr>5 class names (as you suggested)</li>
<li>Use only the simplified doctype and those elements that will only be benificial in the future or add progressive enchancement (e.g. inline elements such as time.)</li>
</ol>
<p>Its going to be a while until we can use <abbr>HTML</abbr>5 in development projects but in my opinion there isn&#8217;t any reason to not use it on personal projects now. You have to judge it on a case by case basis, but whichever parts you do you will be futureproofed to some extent.</p>
<p>&mdash; Cheers <a href="http://html5doctor.com/author/richc/">Rich</a></p>
<h2><abbr>HTML</abbr>5 and Browser Compatibility</h2>
<p>A lot of people ask this type of question regularly so here&#8217;s a few links that we think are useful.</p>
<ul>
<li><a href="http://a.deveria.com/caniuse/">Can I use</a></li>
<li><a href="http://molly.com/html5/html5-0709.html">Mollys <abbr>HTML</abbr>5 Table</a></li>
<li><a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML_5%29">Comparison of Layout Engines Wiki</a></li>
</ul>
<p>That about wraps up this round of questions, we&#8217;ll be publishing more soon, but in the meantime don&#8217;t be afraid to keep <a href="/ask-the-doctor/">asking the doctor about <abbr>HTML</abbr>5.</a>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<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-2/" rel="bookmark" class="crp_title">Your questions answered #2</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-7/" rel="bookmark" class="crp_title">Your Questions Answered #7</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%233%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-3%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-3%2F&amp;title=Your%20Questions%20Answered%20%233&amp;bodytext=We%27re%20back%20with%20our%20%28semi%29%20regular%20round%20up%20of%20answering%20readers%20HTML5%20related%20questions.%20Right%2C%20let%27s%20not%20mess%20about%20any%20longer%20and%20dive%20straight%20in%20with%20the%20questions." 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-3%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-3%2F&amp;title=Your%20Questions%20Answered%20%233" 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-3%2F&amp;title=Your%20Questions%20Answered%20%233&amp;notes=We%27re%20back%20with%20our%20%28semi%29%20regular%20round%20up%20of%20answering%20readers%20HTML5%20related%20questions.%20Right%2C%20let%27s%20not%20mess%20about%20any%20longer%20and%20dive%20straight%20in%20with%20the%20questions." 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-3%2F&amp;title=Your%20Questions%20Answered%20%233" 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-3%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%233&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-3%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-3%2F&amp;t=Your%20Questions%20Answered%20%233" 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-3%2F&amp;title=Your%20Questions%20Answered%20%233&amp;annotation=We%27re%20back%20with%20our%20%28semi%29%20regular%20round%20up%20of%20answering%20readers%20HTML5%20related%20questions.%20Right%2C%20let%27s%20not%20mess%20about%20any%20longer%20and%20dive%20straight%20in%20with%20the%20questions." 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%233&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyour-questions-answered-3%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-3%2F&amp;t=Your%20Questions%20Answered%20%233" 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-3%2F&amp;title=Your%20Questions%20Answered%20%233&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%27re%20back%20with%20our%20%28semi%29%20regular%20round%20up%20of%20answering%20readers%20HTML5%20related%20questions.%20Right%2C%20let%27s%20not%20mess%20about%20any%20longer%20and%20dive%20straight%20in%20with%20the%20questions." 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-3%2F&amp;h=Your%20Questions%20Answered%20%233" 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-3%2F&amp;t=Your%20Questions%20Answered%20%233&amp;s=We%27re%20back%20with%20our%20%28semi%29%20regular%20round%20up%20of%20answering%20readers%20HTML5%20related%20questions.%20Right%2C%20let%27s%20not%20mess%20about%20any%20longer%20and%20dive%20straight%20in%20with%20the%20questions." 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-3/" rel="bookmark">Your Questions Answered #3</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on October 22, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/your-questions-answered-3/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Absent Elements and Validation</title>
		<link>http://html5doctor.com/absent-elements-and-validation/</link>
		<comments>http://html5doctor.com/absent-elements-and-validation/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 14:30:14 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Questions]]></category>
		<category><![CDATA[Validation]]></category>
		<category><![CDATA[WAI-ARIA]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[HTML 5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=777</guid>
		<description><![CDATA[We received the below question from Guy Carberry who was wondering what affect changing the doctype on your <abbr>HTML</abbr> or <abbr>XHTML</abbr> pages to the <abbr>HTML</abbr> 5 doctype will have on those elements that are deprecated current draft.]]></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%2Fabsent-elements-and-validation%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fabsent-elements-and-validation%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>We received the below question from Guy Carberry who was wondering what effect changing the doctype on your <abbr>HTML</abbr> or <abbr>XHTML</abbr> pages to the <abbr>HTML</abbr> 5 doctype will have on those elements that are deprecated current draft.</p>
<h2>The Question</h2>
<p>There are several aspects to consider from this question so lets start by taking a look at Guys question in full.</p>
<blockquote><p>
Jeremy Keith says that we can change the Doctype declaration on XHTML 1.0 syntax pages to <cod>&lt;!DOCTYPE html&gt;</code> and it will immediately become HTML 5.</p>
<p>I'm a bit confused about what that means for the Absent and changed elements and attributes info detailed here: <a href="http://www.w3.org/TR/html5-diff/#absent-elements">http://www.w3.org/TR/html5-diff/#absent-elements</a></p>
<p><q>"Some attributes from HTML 4 are no longer allowed in HTML 5. If they need to have any impact on user agents for compatibility reasons it is defined how they should work in those scenarios."</q></p>
<p>So if this is that case, how can you switch the doctype declarations and all be fine?</p>
<p>Thanks for your help,</p>
<p>Guy.
</p></blockquote>
<h2>The Doctors Response</h2>
<p>In answering the question we will need to break the question down into the following:</p>
<ol>
<li>Which elements or attributes are deprecated?</li>
<li>Do I use any of those elements or attributes on my site?</li>
<li>How much do I need to worry about validation?</li>
<li>What effect will this have for backwards compatibility?</li>
<li>Can my content be accessed in all my target browsers and user agents?</li>
</ol>
<p>Lets consider each of these in some more detail below.</p>
<h3>1. Which elements or attributes are deprecated?</h3>
<p>The elements deprecated (from HTML 4.01) from the <abbr>HTML</abbr> 5 specification are: <code>basefont, big, center, font, s, strike, tt, u, frame, frameset, noframes, acronym, applet, isindex, dir</code></p>
<p>You can find a list of those <a href="http://www.w3.org/TR/html5-diff/#absent-elements">elements</a> and <a href="http://www.w3.org/TR/html5-diff/#absent-attributes">attributes</a> along with detailed reasons of why they've been removed by reading <a href="http://www.w3.org/TR/html5-diff"><abbr>HTML<abb> 5 differences from <abbr>HTML</abbr> 5</a>.</p>
<h3>2. Do I use any of those elements or attributes on my site?</h3>
<p>If your site uses any of the above named elements or attributes you may consider changing them to more semantic elements as introduced in <abbr>HTML</abbr> 5. Alternatively you may decide to remove them and use <abbr>CSS</abbr> for presentation in the case of <code>&lt;font&gt;</code> or <code>&lt;center&gt;</code>.</p>
<p>Guy told use that he works for a large university. The site uses a large number of <code>&lt;acronym&gt;</code> tags which have been removed from <abbr>HTML</abbr> 5 as detailed above. To solve this issue for Guy, I feel he has three options if he wishes to make the site: <abbr>HTML</abbr> 5:</p>
<ol>
<li>Change the doctype to <abbr>HTML</abbr> 5 and leave the <code>&lt;acronym&gt;</code> elements in. (Bear in mind the <abbr>HTML</abbr> won't validate)</li>
<li>Change the doctype to <abbr>HTML</abbr> 5 edit the <code>&lt;acronym&gt;</code> elements to become <code>&lt;abbr&gt;</code> elements as advised by the specification</li>
<li>Do nothing and leave the site as <abbr>HTML</abbr> 4.01 or <abbr>XHTML</abbr></li>
</ol>
<p>It's difficult to be able to advise Guy on which option he should choose without knowing the full extent of the effort involved to implement these solutions or knowing the sites goals and project teams views on validation. Speaking of validation, the whole area is a minefield and it's what we'll attempt to cover next.</p>
<h3>3. How much do I need to worry about validation?</h3>
<p>While validation is undoubtedly important for your markup and your <abbr>CSS</abbr>, in my opinion it isn't crucial to a site. Allow me to explain, we recently received a couple of emails pointing out that this site doesn't validate. While there were some errors that have now been corrected, a primary reason why is the use of <abbr title="Accessible Rich Internet Applications">ARIA</abbr> roles in the markup. These attributes currently aren't allowed in the current specification, however there is work underway to make this happen.</p>
<p>To illustrate this point let's look at Google, the search giant. If you look at the source on Google's search pages you'll see they use the <abbr>HTML</abbr> 5 doctype.</p>
<pre><code>&lt;!DOCTYPE html&gt;</code></pre>
<p><aside><q>HTML 5 takes a "pave the cowpaths" approach to development</q></aside></p>
<p>However, those pages don't validate because they use the <code>&lt;font&gt;</code> and <code>&lt;center&gt;</code> elements amongst others things that we already know have been removed from the specification. Does this mean that users stop visiting Google? <em>No</em>.</p>
<p>Remember too that the specification is yet to be finalised and may still be changed (thus breaking you're perfectly valid docments), in partnership with this changes to the specification may not immediately take be implemented in the validators.  We also need to bear in mind that <abbr>HTML</abbr> 5 takes a "pave the cowpaths" approach to development, meaning that the Hixie, et al will look at what authors already do and improve upon it. </p>
<h3>4. What effect will this have for backwards compatibility?</h3>
<p>Leading on from the point about Google as mentioned previously we know Googles site not validating doesn't matter but is it still backwards compatible? <em>Yes</em>. As far as we know, all the browsers support the <code>&lt;font&gt;</code> tag.  It's the validators that don't.  If you want to use an antiquated element you can do, the browser will still handle it - it just won't validate.</p>
<p>In terms of backwards compatibility there is no reason why you couldn't start using new <abbr>HTML</abbr> 5 elements in your <abbr>HTML</abbr> 4.01 or <abbr>XHTML</abbr> 1.x documents, it could even be described as progressive enhancement. For example, why not include the <code>&lt;video&gt;</code> element? It <em>won't</em> validate but maybe that doesn't matter? The browser will still be able to render video, hence <q>"paving the cowpaths"</q>. Having said that if you're going to the effort of including new elements why not go the whole hog and change the doctype too?</p>
<h3>5. Can my content be accessed in all my target browsers and user agents?</h3>
<p>Again to look at Google, it still renders in older browswers and devices but to all intents and purposes it's <abbr>HTML</abbr> 5. Another aspect that the specification defines is that new features should work in or not break in older browsers.</p>
<p><a href="/author/remys/">Remy</a> pointed out in a response to Guy that</p>
<blockquote><p>
Remember that the browser is still going to handle this, regardless of whether <abbr>HTML</abbr> 5 supports this or not. Just like and <abbr>XHTML</abbr> document although doesn't validate with frames, it still renders fine and still supports frames.
</p></blockquote>
<p>So from that we can conclude that browsers will still render deprecated elements or practices. </p>
<h2>Summary</h2>
<p>To wrap up I think we can answer Guys question by saying yes, changing the doctype will make your site <abbr>HTML</abbr> 5, but whether or not it validates is in essence an entirely personal or business decision. Whether this means you are making use of all the benefits of <abbr>HTML</abbr> 5's new elements, javascript API's or offline storage is a whole different subject.
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/html-5-xml-xhtml-5/" rel="bookmark" class="crp_title">HTML 5 + XML = XHTML 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/html-5-boilerplates/" rel="bookmark" class="crp_title">HTML5 Boilerplates</a></li>
<li><a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/" rel="bookmark" class="crp_title">How to use HTML5 in your client work right now</a></li>
<li><a href="http://html5doctor.com/your-questions-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=Absent%20Elements%20and%20Validation%20-%20http%3A%2F%2Fhtml5doctor.com%2Fabsent-elements-and-validation%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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation&amp;bodytext=We%20received%20the%20below%20question%20from%20Guy%20Carberry%20who%20was%20wondering%20what%20affect%20changing%20the%20doctype%20on%20your%20HTML%20or%20XHTML%20pages%20to%20the%20HTML%205%20doctype%20will%20have%20on%20those%20elements%20that%20are%20deprecated%20current%20draft." 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%2Fabsent-elements-and-validation%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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation" 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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation&amp;notes=We%20received%20the%20below%20question%20from%20Guy%20Carberry%20who%20was%20wondering%20what%20affect%20changing%20the%20doctype%20on%20your%20HTML%20or%20XHTML%20pages%20to%20the%20HTML%205%20doctype%20will%20have%20on%20those%20elements%20that%20are%20deprecated%20current%20draft." 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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation" 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%2Fabsent-elements-and-validation%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=Absent%20Elements%20and%20Validation&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fabsent-elements-and-validation%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%2Fabsent-elements-and-validation%2F&amp;t=Absent%20Elements%20and%20Validation" 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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation&amp;annotation=We%20received%20the%20below%20question%20from%20Guy%20Carberry%20who%20was%20wondering%20what%20affect%20changing%20the%20doctype%20on%20your%20HTML%20or%20XHTML%20pages%20to%20the%20HTML%205%20doctype%20will%20have%20on%20those%20elements%20that%20are%20deprecated%20current%20draft." 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=Absent%20Elements%20and%20Validation&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fabsent-elements-and-validation%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%2Fabsent-elements-and-validation%2F&amp;t=Absent%20Elements%20and%20Validation" 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%2Fabsent-elements-and-validation%2F&amp;title=Absent%20Elements%20and%20Validation&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%20received%20the%20below%20question%20from%20Guy%20Carberry%20who%20was%20wondering%20what%20affect%20changing%20the%20doctype%20on%20your%20HTML%20or%20XHTML%20pages%20to%20the%20HTML%205%20doctype%20will%20have%20on%20those%20elements%20that%20are%20deprecated%20current%20draft." 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%2Fabsent-elements-and-validation%2F&amp;h=Absent%20Elements%20and%20Validation" 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%2Fabsent-elements-and-validation%2F&amp;t=Absent%20Elements%20and%20Validation&amp;s=We%20received%20the%20below%20question%20from%20Guy%20Carberry%20who%20was%20wondering%20what%20affect%20changing%20the%20doctype%20on%20your%20HTML%20or%20XHTML%20pages%20to%20the%20HTML%205%20doctype%20will%20have%20on%20those%20elements%20that%20are%20deprecated%20current%20draft." 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/absent-elements-and-validation/" rel="bookmark">Absent Elements and Validation</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on August 25, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/absent-elements-and-validation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Legend not such a legend anymore</title>
		<link>http://html5doctor.com/legend-not-such-a-legend-anymore/</link>
		<comments>http://html5doctor.com/legend-not-such-a-legend-anymore/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 12:00:26 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[details]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[legend]]></category>

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

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

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

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

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

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

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

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

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

<h2>The issues</h2>

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

<p>Other problems include:</p>

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

<h2>Legend treatment</h2>

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

<h3>Internet Explorer</h3>

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

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

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

<h3>Opera</h3>

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

<h3>Safari</h3>

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

<h3>Firefox</h3>

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

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

<h2>Impact on other elements</h2>

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

<h2>Conclusion</h2>

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

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

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

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

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

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

<p>Share and Save:</p>

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

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/legend-not-such-a-legend-anymore/" rel="bookmark">Legend not such a legend anymore</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 31, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/legend-not-such-a-legend-anymore/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Native Audio in the browser</title>
		<link>http://html5doctor.com/native-audio-in-the-browser/</link>
		<comments>http://html5doctor.com/native-audio-in-the-browser/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:00:29 +0000</pubDate>
		<dc:creator>Mark Boas</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[codecs]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=497</guid>
		<description><![CDATA[Until very recently the ability to play any type of audio within a browser involved using Adobe Flash or other browser plugins. Although Adobe's Flash player is without doubt the most ubiquitous of these, most developers and designers would agree it is better not to rely on a plugin at all. Now thanks to HTML 5 and the browsers that implement its audio tag we can play audio natively within the browser.]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
            <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F">
                <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
            </a>
        </div>Until recently, the ability to play any type of audio within a browser involved using Adobe Flash or other browser plugins. Although Adobe&#8217;s Flash player is unquestionably the most ubiquitous of these, most developers and designers would agree that it&#8217;s better not to rely on a plugin at all.</p>

<h2>Enter <abbr>HTML</abbr> 5 <code>&lt;audio&gt;</code></h2>

<p>One of the most exciting and long-awaited features in <abbr>HTML</abbr> 5 the <code>&lt;audio&gt;</code> element, enabling native audio playback within the browser. We can take advantage of this for browsers that support it &mdash; such as Safari 4, Firefox 3.5 and Chrome 3 &mdash; while falling back on Flash or other plugins for other browsers.</p>

<h3>According to spec</h3>

<p>Currently, the <abbr>HTML</abbr> 5 spec defines five attributes for the <code>&lt;audio&gt;</code> element:</p>

<ol>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-src"><code>src</code></a> &mdash; a valid <abbr>URL</abbr> specifying the content source</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-autobuffer"><code>autobuffer</code></a> &mdash; a boolean specifying whether the file is to be buffered in advance</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-autoplay"><code>autoplay</code></a> &mdash; a boolean specifying whether the file should play as soon as it can</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-loop"><code>loop</code></a> &mdash; a boolean specifying whether the file should be repeatedly played.</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#attr-media-controls"><code>controls</code></a> &mdash; a boolean specifying whether the browser should display its default media controls</li>
</ol>

<p>Note that these are the same attributes defined for the <code>&lt;video&gt;</code> element.</p>

<h3>Examples</h3>

<p>Let&#8217;s take a couple of these attributes and create a simple example that will play an audio file:</p>

<pre><code>&lt;audio src="elvis.ogg" controls autobuffer&gt;&lt;/audio&gt;
</code></pre>

<p>(This example will work for Firefox 3.5 and Chrome 3. You&#8217;ll need to replace the Ogg file with an MP3 to get it working in Safari 4.)</p>

<p>Of course, the spec is not finalised, and there isn&#8217;t yet a consensus on which codecs to support. This table details the codecs supported by today&#8217;s browsers:</p>

<table>
  <caption>Codec support in modern browsers</caption>
  <thead>
    <tr>
      <th>Browser</th>
      <th>Ogg Vorbis</th>
      <th>MP3</th>
      <th>WAV</th>
    </tr>
  </thead>
  <tbody>
    <td>FireFox 3.5</td>
      <td>✓</td>
      <td></td>
      <td>✓</td>
    </tr>
    <tr>
      <td>Safari 4</td>
      <td></td>
      <td>✓</td>
      <td>✓</td>
    </tr>
    <tr>
      <td>Chrome 3 (beta)</td>
      <td>✓</td>
      <td>✓</td>
      <td></td>
    </tr>
    <tr>
      <td>Opera 10 (beta)</td>
      <td></td>
      <td></td>
      <td>✓</td>
    </tr>
  </tbody>
</table>

<p>To create our own controls, we can use the <abbr>API</abbr> methods defined by the spec:</p>

<ul>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-play"><code>play()</code></a> &mdash; plays the audio</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-pause"><code>pause()</code></a> &mdash; pauses the audio</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-navigator-canplaytype"><code>canPlayType()</code></a> &mdash; interrogates the browser to establish whether the given mime type can be played</li>
<li><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#dom-media-buffered"><code>buffered()</code></a> &mdash; attribute that specifies the start and end time of the buffered part of the file</li>
</ul>

<p>Note that Opera 10 does not support the <code>&lt;audio&gt;</code> <abbr>HTML</abbr> element, but it does support the <code>Audio()</code> <abbr>API</abbr> in a basic and unique manner: from the above list, it only supports the <code>play()</code> method. </p></p>

<p>Safari 4, Firefox 3.5, and Chrome 3 beta support both <code>&lt;audio&gt;</code> and <code>Audio()</code>. Internet Explorer 8 has no native audio support whatsoever.</p>

<h2>Use the Source</h2>

<p>The best way to coerce browsers into playing audio (or video, for that matter) is to use the <code>&lt;source&gt;</code> element. The browser will try to load the first audio source, and if it fails or isn&#8217;t supported, it will move on to the next audio source. In addition, we can embed a Flash player if all else fails:</p></p>

<pre><code>&lt;audio controls autobuffer&gt;
  &lt;source src="elvis.ogg" /&gt;
  &lt;source src="elvis.mp3" /&gt;
  &lt;!-- now include flash fall back --&gt;
&lt;/audio&gt;
</code></pre>

<p>One caveat, though: you need to be careful about the order of the <code>&lt;source&gt;</code> elements. Because of a bug in Firefox, if you list the MP3 first (which Firefox doesn&#8217;t support), it will silently fail and refuse to render that particular <code>&lt;audio&gt;</code> element. The trick is to list the Ogg Vorbis file first and the other formats after. Webkit (Safari and Chrome) handle unsupported formats just fine.</p>

<p>Opera is another kettle of fish altogether, which we&#8217;ll need to solve using JavaScript.</p>

<h2>Cross-Browser Implementation</h2>

<p>When we created <a href="http://happyworm.com/jquery/jplayer">jPlayer</a>, an audio player plugin for jQuery, we were attempting to address some of the limitations of the current crop of Flash-based audio players. Many relied on Flash to implement the player&#8217;s graphical interface, effectively isolating the player from the rest of the web design process.</p>

<p>The original jPlayer relied on Flash to play the actual audio while allowing the look and feel to be styled via <abbr>HTML</abbr> and <abbr>CSS</abbr>. With growing support for <abbr>HTML</abbr> 5 in modern browsers, we were inspired to break our Flash dependency and use native audio when it was supported.</p>

<p>The most significant issue is the cross-browser implementation, where lack of a common supported audio format among browsers causes complications. If developers want to take full advantage of all browsers that support <abbr>HTML</abbr> 5 audio, they&#8217;ll need to create both MP3 and Ogg (and in Opera&#8217;s case, WAV) versions of the audio file they want to stream!</p>

<p>Our job was made more difficult by the lack of available information:</p>

<ul>
<li><a href="https://developer.mozilla.org/en/nsIDOMHTMLMediaElement">Firefox 3.5</a> &mdash; quite a detailed document</li>
<li><a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/HTMLMediaElement_idl/Classes/HTMLMediaElement/index.html#//apple_ref/js/cl/HTMLMediaElement">Safari 4</a> &mdash; technically complete, but lacks explanations and examples</li>
<li><a href="http://www.opera.com/docs/specs/presto22/#html">Opera 10</a> &mdash; only a short note</li>
<li><a href="http://code.google.com/p/doctype/wiki/AudioElement">Chrome 3</a> &mdash; a wiki</li>
</ul>

<p>Since the <abbr>HTML</abbr> 5 standard is still a work in progress, several aspects of the <code>&lt;audio&gt;</code> element vary from browser to browser. For example, there seems to be no way to determine the load progress of an audio file. Although Safari 4 can determine how much of an audio file has downloaded, Firefox 3.5 does not yet implement the <a href="https://developer.mozilla.org/en/nsIDOMHTMLMediaElement"><code>buffered</code></a> DOM attribute. (It is, however, included as part of the Firefox&#8217;s documentation, so we presume it will be implemented.)</p>

<p>Firefox 3.5 does appear to enable &#8220;seeking&#8221; of the file, allowing you to start the download from any point in the media. Other browsers, such as Safari 4, grab the file from the beginning and only allow seeking within the part already downloaded (or wait until the particular part being seeked to has been downloaded).</p>

<p>Although these inconsistencies aren&#8217;t showstoppers, in order to compete effectively with plugin-based solutions, we believe any <abbr>HTML</abbr> 5 audio implementation should be consistent across all browsers and match current implementations feature for feature.</p>

<h3>JavaScript solutions</h3>

<p>If we intend to take advantage of each browser&#8217;s audio capabilities, we need to create different solutions for different browsers. We could use browser sniffing, but considering the rapidly changing landscape, it&#8217;s better to check what capabilities a particular browser supports and adapt accordingly.</p>

<p>To demonstrate this &#8220;feature sniffing&#8221;, we&#8217;ve created a rough and ready <a href="http://www.happyworm.com/jquery/jplayer/HTML5.Audio.Support"><abbr>HTML</abbr> 5 audio checker</a>.</p>

<p>Using JavaScript, you can check for audio tag support:</p>

<pre><code>// returns a boolean
var audioTagSupport = !!(document.createElement('audio').canPlayType);
</code></pre>

<p>or check for the <code>Audio()</code> object:</p>

<pre><code>try {
  // The 'src' parameter is mandatory in Opera 10, so have used an empty string "".
  // Otherwise, an exception is thrown.
  myAudioObj = new Audio(""); 

  audioObjSupport = !!(myAudioObj.canPlayType);
  basicAudioSupport = !!(!audioObjSupport ? myAudioObj.play : false);
} catch (e) {
  audioObjSupport = false;
  basicAudioSupport = false;
}
</code></pre>

<p>or check file type compatibility:</p>

<pre><code>// Need to check the canPlayType first or an exception
// will be thrown for those browsers that don't support it
if (myAudio.canPlayType) {

  // Currently canPlayType(type) returns: "no", "maybe" or "probably"
  canPlayOgg = ("no" != myAudio.canPlayType("audio/ogg")) &amp;#038;&amp; ("" != myAudio.canPlayType("audio/ogg"));
  canPlayMp3 = ("no" != myAudio.canPlayType("audio/mpeg")) &amp;#038;&amp; ("" != myAudio.canPlayType("audio/mpeg"));
}
</code></pre>

<p>Note that to change the <code>src</code> attribute of an audio object or element, you&#8217;ll need to recreate the object or element with the new value for its <code>src</code> attribute.</p>

<p>So, to create a solution that takes full advantage of <abbr>HTML</abbr> 5 audio, you&#8217;ll typically need to:</p>

<ol>
<li>check for HTML 5 audio support, and if not present, fall back on Flash,</li>
<li>check the level of HTML 5 audio support and adapt your code accordingly for each browser, and</li>
<li>check what file types are supported and link to appropriate formats of the files.</li>
</ol>

<h2>The Road Ahead</h2>

<p>Although <abbr>HTML</abbr> 5 audio is a relatively immature part of the standard, if recent trends continue and users upgrade to the latest versions of Safari and Firefox, browser support will likely rise above the 25% mark in the very near future. This is a significant chunk of the browser market that will no longer need to rely on Adobe&#8217;s Flash, Microsoft&#8217;s Silverlight, or any other browser plugin for audio support.</p>

<p>And when you consider that mobile and other lower-spec devices &mdash; like Apple&#8217;s iPod and iPhone (Safari), Nintendo&#8217;s Wii (Opera), and Google Android-powered devices (Chrome) &mdash; are choosing to support <abbr>HTML</abbr> 5 audio rather than Flash, you begin to paint a picture of how important native audio support will soon become.</p>

<h2>Further reading:</h2>

<ul>
<li><a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-June/020620.html">&#91;whatwg&#93; Codecs for <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code></a></li>
<li><a href="http://my.opera.com/community/forums/topic.dml?id=274889&#038;t=1247218254&#038;page=1#comment2974635">Opera 10 work around for Audio</a></li>
<li><a href="http://stackoverflow.com/questions/1007223/which-browsers-support-the-html-5-audio-tag-on-windows-today/1009015#1009015">Which browsers support <abbr>HTML</abbr> 5 <code>&lt;audio&gt;</code> on Windows today?</a></li>
</ul>

<p><div id="crp_related"><h3>Related Posts:</h3><ul><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><li><a href="http://html5doctor.com/youtube-and-vimeo-support-html5-video/" rel="bookmark" class="crp_title">YouTube and Vimeo support HTML5 Video</a></li><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/legend-not-such-a-legend-anymore/" rel="bookmark" class="crp_title">Legend not such a legend anymore</a></li></ul></div></p>

<p>Share and Save:</p>

<pre><code>&lt;a rel="nofollow"  href="http://twitter.com/home?status=Native%20Audio%20in%20the%20browser%20-%20http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Twitter"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;bodytext=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Digg"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Sphinn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser" title="Reddit"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;notes=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="del.icio.us"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser" title="StumbleUpon"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Technorati"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.netvibes.com/share?title=Native%20Audio%20in%20the%20browser&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="Netvibes"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser" title="Facebook"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;annotation=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Google Bookmarks"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.friendfeed.com/share?title=Native%20Audio%20in%20the%20browser&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F" title="FriendFeed"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser" title="HackerNews"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;title=Native%20Audio%20in%20the%20browser&amp;amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;amp;summary=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="LinkedIn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;h=Native%20Audio%20in%20the%20browser" title="NewsVine"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;amp;u=http%3A%2F%2Fhtml5doctor.com%2Fnative-audio-in-the-browser%2F&amp;amp;t=Native%20Audio%20in%20the%20browser&amp;amp;s=Until%20very%20recently%20the%20ability%20to%20play%20any%20type%20of%20audio%20within%20a%20browser%20involved%20using%20Adobe%20Flash%20or%20other%20browser%20plugins.%20Although%20Adobe%27s%20Flash%20player%20is%20without%20doubt%20the%20most%20ubiquitous%20of%20these%2C%20most%20developers%20and%20designers%20would%20agree%20it%20is%20better%20not%20to%20rely%20on%20a%20plugin%20at%20all.%20Now%20thanks%20to%20HTML%205%20and%20the%20browsers%20that%20implement%20its%20audio%20tag%20we%20can%20play%20audio%20natively%20within%20the%20browser." title="Tumblr"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /&gt;&lt;/a&gt;
</code></pre>

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/native-audio-in-the-browser/" rel="bookmark">Native Audio in the browser</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 29, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/native-audio-in-the-browser/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>HTML5 Reset Stylesheet</title>
		<link>http://html5doctor.com/html-5-reset-stylesheet/</link>
		<comments>http://html5doctor.com/html-5-reset-stylesheet/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 14:00:42 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Boilerplates]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=622</guid>
		<description><![CDATA[We've had a number of people asking about templates, boilerplates and styling for <abbr>HTML</abbr> 5 so to give you all a helping hand and continue on from those basic building blocks that Remy talked about last week I've created a HTML 5 reset stylesheet for you to take away and use, edit, amend and update in your projects.]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
            <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F">
                <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
            </a>
        </div>We&#8217;ve had a number of people ask about templates, boilerplates, and styling for <abbr>HTML</abbr> 5. Last week, <a href="/author/remys/">Remy</a> introduced some <a href="/html-5-boilerplates/">basic boilerplates for HTML 5</a>, so to keep the momentum going, I&#8217;ve modified <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s <abbr>CSS</abbr> reset</a> for you to use in your HTML 5 projects.</p>

<h2>The code</h2>

<p>Let&#8217;s start with the complete <abbr>CSS</abbr> stylesheet:</p>

<pre><code>/* 
html5doctor.com Reset Stylesheet
v1.4.1 
2010-03-01
Author: Richard Clark - http://richclarkdesign.com
*/

html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

body {
    line-height:1;
}

article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary { 
    display:block;
}

nav ul {
    list-style:none;
}

blockquote, q {
    quotes:none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}

a {
    margin:0;
    padding:0;
    border:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}

mark {
    background-color:#ff9;
    color:#000; 
    font-style:italic;
    font-weight:bold;
}

del {
    text-decoration: line-through;
}

abbr[title], dfn[title] {
    border-bottom:1px dotted #000;
    cursor:help;
}

table {
    border-collapse:collapse;
    border-spacing:0;
}

hr {
    display:block;
    height:1px;
    border:0;   
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}

input, select {
    vertical-align:middle;
}</code></pre>

<h2>So what&#8217;s new?</h2>

<p>Quite a bit! The next few sections explain what I changed and why I changed it.</p>

<h3>The basics</h3>

<p>I started by removing elements that have been deprecated from the <abbr>HTML</abbr> 5 specification, like <code>&lt;acronym&gt;</code>, <code>&lt;center&gt;</code> and <code>&lt;big&gt;</code>. (We&#8217;ll cover deprecated elements in more detail in another post). I also added new <abbr>HTML</abbr> 5 elements, like <code>and</code>, in order to remove any default padding, margin, and borders. I&#8217;ve also added an explicit <code>display:block</code> property for elements that are required to render as blocks.</p>

<p>I also removed the explicit unstyling of the <code>:focus</code> pseudo-class. There are two reasons for this. First, by declaring <code>outline:0</code>, you remove the focus identifier for keyboard users. Second, Eric released his stylesheet in good faith that people would explicitly style <code>:focus</code>, but they generally don&#8217;t, so it&#8217;s safer to leave the default <code>:focus</code> styles in place. (I also set defaults for <code>&lt;ins&gt;</code>, since I don&#8217;t think that got updated very often either.)</p>

<p>I&#8217;ve left the default list styles in place simply as a personal preference. I tend to add the list style back when using Eric&#8217;s reset anyway. I have, however, included <code>nav ul {list-style:none;}</code> to remove those pesky bullets from your navigation. </p>

<h3>Using attribute selectors</h3>

<p>You&#8217;ll notice that I&#8217;ve included attribute selectors for <code>&lt;abbr&gt;</code> and <code>&lt;dfn&gt;</code>. This way, the style will only appear <em>if</em> there is a title attribute on the element. This is primarily for accessibility. For example, we use <code>&lt;abbr&gt;</code> regularly on this site but don&#8217;t always include a title attribute. We think it&#8217;s safe to assume all of our readers (no matter what device they&#8217;re using) know what <abbr>HTML</abbr> stands for. We do still use the <code>&lt;abbr&gt;</code> element to make sure screen readers read the text as H-T-M-L rather than struggling to pronounce &#8220;HTML&#8221;.</p>

<h3>What&#8217;s that bit about mark?</h3>

<p><code>&lt;mark&gt;</code> is a new element introduced in <abbr>HTML</abbr> 5 used to (you guessed it) mark text in a document. According to the spec: <q>&#8220;The mark element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context.&#8221;</q>. I anticipate it will be used for highlighting phrases in search results and other similar purposes. We&#8217;ll post more on <code>&lt;mark&gt;</code> soon.</p>

<h2>Where are all those application elements?</h2>

<p>Application elements is a term I&#8217;ve loosely used to describe elements like menu, etc. These elements are more likely found in web <em>apps</em> than web <em>sites</em>. I left these out since, at the time of writing, browsers implement barely any of what was &#8220;Web Applications 1.0&#8243;. Also, this stylesheet is intended primarily for authors serving their pages as <code>text/html</code>, not <abbr>XML</abbr>.</p>

<h2>Go grab it</h2>

<p>The stylesheet is released under a Creative Commons license, so you can use it for both personal and commercial work. I thought I&#8217;d let Google take care of the hosting, so go <a href="http://code.google.com/p/html5resetcss/downloads/list">grab it from Google Code</a> and let us know about any improvements you make!</p>

<ul>
<li><a href="http://code.google.com/p/html5resetcss/downloads/list">HTML 5 Reset Stylesheet</a><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/html-5-boilerplates/" rel="bookmark" class="crp_title">HTML5 Boilerplates</a></li><li><a href="http://html5doctor.com/absent-elements-and-validation/" rel="bookmark" class="crp_title">Absent Elements and Validation</a></li><li><a href="http://html5doctor.com/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/summary-figcaption-element/" rel="bookmark" class="crp_title">Hello, summary and figcaption elements</a></li></ul></div></li>
</ul>

<p>Share and Save:</p>

<pre><code>&lt;a rel="nofollow"  href="http://twitter.com/home?status=HTML5%20Reset%20Stylesheet%20-%20http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F" title="Twitter"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet&amp;amp;bodytext=We%27ve%20had%20a%20number%20of%20people%20asking%20about%20templates%2C%20boilerplates%20and%20styling%20for%20HTML%205%20so%20to%20give%20you%20all%20a%20helping%20hand%20and%20continue%20on%20from%20those%20basic%20building%20blocks%20that%20Remy%20talked%20about%20last%20week%20I%27ve%20created%20a%20HTML%205%20reset%20stylesheet%20for%20you%20to%20take%20away%20and%20use%2C%20edit%2C%20amend%20and%20update%20in%20your%20projects." title="Digg"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F" title="Sphinn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet" title="Reddit"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet&amp;amp;notes=We%27ve%20had%20a%20number%20of%20people%20asking%20about%20templates%2C%20boilerplates%20and%20styling%20for%20HTML%205%20so%20to%20give%20you%20all%20a%20helping%20hand%20and%20continue%20on%20from%20those%20basic%20building%20blocks%20that%20Remy%20talked%20about%20last%20week%20I%27ve%20created%20a%20HTML%205%20reset%20stylesheet%20for%20you%20to%20take%20away%20and%20use%2C%20edit%2C%20amend%20and%20update%20in%20your%20projects." title="del.icio.us"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet" title="StumbleUpon"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F" title="Technorati"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.netvibes.com/share?title=HTML5%20Reset%20Stylesheet&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F" title="Netvibes"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;t=HTML5%20Reset%20Stylesheet" title="Facebook"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet&amp;amp;annotation=We%27ve%20had%20a%20number%20of%20people%20asking%20about%20templates%2C%20boilerplates%20and%20styling%20for%20HTML%205%20so%20to%20give%20you%20all%20a%20helping%20hand%20and%20continue%20on%20from%20those%20basic%20building%20blocks%20that%20Remy%20talked%20about%20last%20week%20I%27ve%20created%20a%20HTML%205%20reset%20stylesheet%20for%20you%20to%20take%20away%20and%20use%2C%20edit%2C%20amend%20and%20update%20in%20your%20projects." title="Google Bookmarks"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.friendfeed.com/share?title=HTML5%20Reset%20Stylesheet&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F" title="FriendFeed"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;t=HTML5%20Reset%20Stylesheet" title="HackerNews"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;title=HTML5%20Reset%20Stylesheet&amp;amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;amp;summary=We%27ve%20had%20a%20number%20of%20people%20asking%20about%20templates%2C%20boilerplates%20and%20styling%20for%20HTML%205%20so%20to%20give%20you%20all%20a%20helping%20hand%20and%20continue%20on%20from%20those%20basic%20building%20blocks%20that%20Remy%20talked%20about%20last%20week%20I%27ve%20created%20a%20HTML%205%20reset%20stylesheet%20for%20you%20to%20take%20away%20and%20use%2C%20edit%2C%20amend%20and%20update%20in%20your%20projects." title="LinkedIn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;h=HTML5%20Reset%20Stylesheet" title="NewsVine"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;amp;u=http%3A%2F%2Fhtml5doctor.com%2Fhtml-5-reset-stylesheet%2F&amp;amp;t=HTML5%20Reset%20Stylesheet&amp;amp;s=We%27ve%20had%20a%20number%20of%20people%20asking%20about%20templates%2C%20boilerplates%20and%20styling%20for%20HTML%205%20so%20to%20give%20you%20all%20a%20helping%20hand%20and%20continue%20on%20from%20those%20basic%20building%20blocks%20that%20Remy%20talked%20about%20last%20week%20I%27ve%20created%20a%20HTML%205%20reset%20stylesheet%20for%20you%20to%20take%20away%20and%20use%2C%20edit%2C%20amend%20and%20update%20in%20your%20projects." title="Tumblr"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /&gt;&lt;/a&gt;
</code></pre>

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/html-5-reset-stylesheet/" rel="bookmark">HTML5 Reset Stylesheet</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 27, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html-5-reset-stylesheet/feed/</wfw:commentRss>
		<slash:comments>114</slash:comments>
		</item>
		<item>
		<title>2022, or when will HTML 5 be ready?</title>
		<link>http://html5doctor.com/2022-or-when-will-html-5-be-ready/</link>
		<comments>http://html5doctor.com/2022-or-when-will-html-5-be-ready/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 14:19:00 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[Ian Hickson]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[WHATWG]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=548</guid>
		<description><![CDATA[Aside from being the year Queen Elizabeth II will celebrate her Platinum Jubilee, assuming she's still kicking around, 2022 is the year that's been inappropriate linked with HTML 5 in the minds of a lot of our community.  I understand why someone might think that, but it's wrong.  *2022* was misinterpreted as the year <abbr>HTML</abbr> 5 would be ready.  That's wrong.  <abbr>HTML</abbr> 5 is ready  <strong>today</strong>.]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
            <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F">
                <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
            </a>
        </div>Aside from being the year Queen Elizabeth II will celebrate her Platinum Jubilee, assuming she&#8217;s still kicking around, 2022 is the year that&#8217;s been inappropriate linked with HTML 5 in the minds of a lot of our community.  </p>

<p>I understand why someone might think that, but it&#8217;s wrong.  <em>2022</em> was misinterpreted as the year <abbr>HTML</abbr> 5 would be ready.  That&#8217;s wrong.  <abbr>HTML</abbr> 5 is ready  <strong>today</strong>.</p>

<p>In an <a href="http://blogs.techrepublic.com.com/programming-and-development/?p=718">interview by Tech Republic</a>, for a techie audience, <a href="http://ln.hixie.ch/" title="Hixie's Natural Log">Ian Hickson</a>, the editor of the HTML 5 working draft, was asked to give a timeline of the HTML 5 recommendation.</p>

<p>One date <em>should</em> have come out of that interview, but another, much further away did instead: 2022 &#8211; the date of the final proposed recommendation, which actually translates to: </p>

<blockquote>
  <p>require at least two browsers to completely pass [<abbr>HTML</abbr> 5 test suites]</p>
</blockquote>

<p>Let&#8217;s put this in context of another spec that has taken a very long time: <abbr>CSS</abbr> 2.1.</p>

<p><abbr>CSS</abbr> 2.1 is <abbr>CSS</abbr> that I&#8217;m <em>certain</em> you&#8217;re familiar with.  I&#8217;m <em>certain</em> you use it day to day without any thought as to whether it&#8217;s a completed spec.  </p>

<p>It&#8217;s been in development for over 10 years, and it&#8217;s <em>only just</em> become a candidate recommendation (23rd April 2009).  </p>

<p>That said, it <strong>doesn&#8217;t</strong> have two browsers completely supporting it.  Only Internet Explorer 8 supports the full <abbr>CSS</abbr> 2.1 spec.  </p>

<p>Did that stop you from using <abbr>CSS</abbr> 2.1?  I suspect not.  Will that stop us from using <abbr>HTML</abbr> 5?  It certainly shouldn&#8217;t. <abbr>HTML</abbr> 5 is available and ready to be used today.</p>

<h2>What <em>is</em> the important <abbr>HTML</abbr> 5 date?</h2>

<p><strong>October 2009</strong>.  </p>

<p>This October is the <em>last call</em> for the <abbr>HTML</abbr> 5 working draft.</p>

<p>That means, that issues with the spec, enhancements, bugs, anything, it all needs to be in and submitted and written in to the spec for October <em>this year</em> (it can go through reiterations, the this is the main deadline).</p>

<p>The <abbr>WHATWG</abbr> is completely open for <em>anyone</em> to contribute their ideas and suggestions.</p>

<p>You can sign up to the <a href="http://www.whatwg.org/mailing-list">mailing lists</a>, look through the backlog of mailing list. You can communicate directly <a href="irc://irc.freenode.net/whatwg">using <abbr>IRC</abbr></a> and there&#8217;s even a complete log of all the <a href="http://krijnhoetmer.nl/irc-logs/"><abbr>IRC</abbr> history</a>.  All available from <a href="http://whatwg.org">http://whatwg.org</a>.
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/dd-details-wrong-again/" rel="bookmark" class="crp_title">dd-details wrong again</a></li><li><a href="http://html5doctor.com/its-bug-report-time/" rel="bookmark" class="crp_title">It&#8217;s bug report time!</a></li><li><a href="http://html5doctor.com/html-5-boilerplates/" rel="bookmark" class="crp_title">HTML5 Boilerplates</a></li><li><a href="http://html5doctor.com/legend-not-such-a-legend-anymore/" rel="bookmark" class="crp_title">Legend not such a legend anymore</a></li><li><a href="http://html5doctor.com/your-questions-answered-6/" rel="bookmark" class="crp_title">Your Questions Answered #6</a></li></ul></div></p>

<p>Share and Save:</p>

<pre><code>&lt;a rel="nofollow"  href="http://twitter.com/home?status=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F%20-%20http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F" title="Twitter"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;bodytext=Aside%20from%20being%20the%20year%20Queen%20Elizabeth%20II%20will%20celebrate%20her%20Platinum%20Jubilee%2C%20assuming%20she%27s%20still%20kicking%20around%2C%202022%20is%20the%20year%20that%27s%20been%20inappropriate%20linked%20with%20HTML%205%20in%20the%20minds%20of%20a%20lot%20of%20our%20community.%20%20I%20understand%20why%20someone%20might%20think%20that%2C%20but%20it%27s%20wrong.%20%20%2A2022%2A%20was%20misinterpreted%20as%20the%20year%20HTML%205%20would%20be%20ready.%20%20That%27s%20wrong.%20%20HTML%205%20is%20ready%20%20today." title="Digg"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F" title="Sphinn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F" title="Reddit"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;notes=Aside%20from%20being%20the%20year%20Queen%20Elizabeth%20II%20will%20celebrate%20her%20Platinum%20Jubilee%2C%20assuming%20she%27s%20still%20kicking%20around%2C%202022%20is%20the%20year%20that%27s%20been%20inappropriate%20linked%20with%20HTML%205%20in%20the%20minds%20of%20a%20lot%20of%20our%20community.%20%20I%20understand%20why%20someone%20might%20think%20that%2C%20but%20it%27s%20wrong.%20%20%2A2022%2A%20was%20misinterpreted%20as%20the%20year%20HTML%205%20would%20be%20ready.%20%20That%27s%20wrong.%20%20HTML%205%20is%20ready%20%20today." title="del.icio.us"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F" title="StumbleUpon"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F" title="Technorati"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.netvibes.com/share?title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F" title="Netvibes"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;t=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F" title="Facebook"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;annotation=Aside%20from%20being%20the%20year%20Queen%20Elizabeth%20II%20will%20celebrate%20her%20Platinum%20Jubilee%2C%20assuming%20she%27s%20still%20kicking%20around%2C%202022%20is%20the%20year%20that%27s%20been%20inappropriate%20linked%20with%20HTML%205%20in%20the%20minds%20of%20a%20lot%20of%20our%20community.%20%20I%20understand%20why%20someone%20might%20think%20that%2C%20but%20it%27s%20wrong.%20%20%2A2022%2A%20was%20misinterpreted%20as%20the%20year%20HTML%205%20would%20be%20ready.%20%20That%27s%20wrong.%20%20HTML%205%20is%20ready%20%20today." title="Google Bookmarks"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.friendfeed.com/share?title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;link=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F" title="FriendFeed"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;t=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F" title="HackerNews"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;title=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;amp;summary=Aside%20from%20being%20the%20year%20Queen%20Elizabeth%20II%20will%20celebrate%20her%20Platinum%20Jubilee%2C%20assuming%20she%27s%20still%20kicking%20around%2C%202022%20is%20the%20year%20that%27s%20been%20inappropriate%20linked%20with%20HTML%205%20in%20the%20minds%20of%20a%20lot%20of%20our%20community.%20%20I%20understand%20why%20someone%20might%20think%20that%2C%20but%20it%27s%20wrong.%20%20%2A2022%2A%20was%20misinterpreted%20as%20the%20year%20HTML%205%20would%20be%20ready.%20%20That%27s%20wrong.%20%20HTML%205%20is%20ready%20%20today." title="LinkedIn"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;amp;save?u=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;h=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F" title="NewsVine"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /&gt;&lt;/a&gt;
&lt;a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;amp;u=http%3A%2F%2Fhtml5doctor.com%2F2022-or-when-will-html-5-be-ready%2F&amp;amp;t=2022%2C%20or%20when%20will%20HTML%205%20be%20ready%3F&amp;amp;s=Aside%20from%20being%20the%20year%20Queen%20Elizabeth%20II%20will%20celebrate%20her%20Platinum%20Jubilee%2C%20assuming%20she%27s%20still%20kicking%20around%2C%202022%20is%20the%20year%20that%27s%20been%20inappropriate%20linked%20with%20HTML%205%20in%20the%20minds%20of%20a%20lot%20of%20our%20community.%20%20I%20understand%20why%20someone%20might%20think%20that%2C%20but%20it%27s%20wrong.%20%20%2A2022%2A%20was%20misinterpreted%20as%20the%20year%20HTML%205%20would%20be%20ready.%20%20That%27s%20wrong.%20%20HTML%205%20is%20ready%20%20today." title="Tumblr"&gt;&lt;img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /&gt;&lt;/a&gt;
</code></pre>

<p>&lt;br/>&lt;br/></p>
<p><a href="http://html5doctor.com/2022-or-when-will-html-5-be-ready/" rel="bookmark">2022, or when will HTML 5 be ready?</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 21, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/2022-or-when-will-html-5-be-ready/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>&#8220;Block-level&#8221; links in HTML5</title>
		<link>http://html5doctor.com/block-level-links-in-html-5/</link>
		<comments>http://html5doctor.com/block-level-links-in-html-5/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 12:00:06 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[a]]></category>
		<category><![CDATA[HTML 5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=455</guid>
		<description><![CDATA[One new and exciting thing you can do in <abbr>HTML</abbr> 5 is wrap links round "block-level" elements. Find out how this works, why it works with true-life sample 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%2Fblock-level-links-in-html-5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>One new and exciting thing you can do in <abbr>HTML</abbr> 5 is wrap links round &#8220;block-level&#8221; elements.</p>
<p>Imagine you have a front page with lots of teasers for news articles, each of which leads to a page devoted to the full text of that article. Obviously, each story needs a heading and you&#8217;ll want an image too, and you&#8217;ll want them all clickable. In current mark-up you&#8217;ll probably have something like this:</p>
<pre><code>&lt;div class="story"&gt;
&lt;h3&gt;&lt;a href=&quot;story1.html&quot;&gt;Bruce Lawson voted sexiest man on Earth&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;story1.html&quot;&gt;&lt;img src=&quot;bruce.jpg&quot; alt=&quot;full story. &quot; /&gt;A congress representing all the planet's women unanimously voted Bruce Lawson as sexiest man alive.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;story1.html&quot;&gt;Read more&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</code>
</pre>
<p>Note that you have three identical links (or two if, like the BBC News site, you assume your readers don&#8217;t need a &#8220;read more&#8221; link).</p>
<p>In <abbr>HTML</abbr> 5, you code it like this:</p>
<pre><code>&lt;article&gt;
&lt;a href=&quot;story1.html&quot;&gt;
&lt;h3&gt;Bruce Lawson voted sexiest man on Earth&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;bruce.jpg&quot; alt=&quot;gorgeous lovebundle. &quot;&gt;A congress representing all the planet's women unanimously voted Bruce Lawson as sexiest man alive.&lt;/p&gt;
&lt;p&gt;Read more&lt;/p&gt;
&lt;/a&gt;
&lt;/article&gt;</code></pre>
<p>Now the single link surrounds the whole teaser, removing duplication and creating a much wider hit area to click.</p>
<p>Two points to make about accessibility in passing: firstly, you don&#8217;t need to worry that each &quot;read more&quot; goes to a different destination (see <a href="http://www.w3.org/TR/WCAG20-HTML-TECHS/G53.html"><abbr title="web contant accessibility guidelines">WCAG</abbr> 2</a>) because the whole story is the link, so the link text is unique. Secondly, note that I&#8217;ve changed the alternate text on the image, as in the first instance the image is  a link so I described its destination, whereas the second is just a picture so I describe the image itself&mdash;&#8221;gorgeous lovebundle&#8221;&mdash;and thereby give more information to a screenreader user.</p>
<h2>Shiny, but not new</h2>
<p>What&#8217;s also very interesting about this technique is that  actually this isn&#8217;t new: you can do it now. <abbr>XHTML</abbr> 2 had a similar mechanism, which allowed <code>href</code> on any element  <a href="http://meyerweb.com/eric/thoughts/2008/07/23/any-element-linking-demo/">Eric Meyer called for this to be adopted</a> in <abbr>HTML</abbr> 5 but, of course, this isn&#8217;t backwardly compatible. One of his other solutions to the same problem was changing the rules for <code>a</code>, and <a href="http://www.brucelawson.co.uk/tests/anchors-wrapping-blocks.htm">my test page</a> shows that it works now in all the browsers.</p>
<p>That&#8217;s one of the interesting things about <abbr>HTML</abbr> 5&mdash;it documents existing browser behaviour. As the browsers already handle wrapping links around block-level elements, and there is an obvious use-case, there was no reason to artificially keep the structure as invalid.</p>
<p>(One irony: Eric Meyer&#8217;s original use-case was to link all cells in a table row. This <em>doesn&#8217;t</em> work in <abbr>HTML</abbr> 5; <a href="http://wiki.whatwg.org/wiki/FAQ#HTML5_should_support_href_on_any_element.21">you need script for that</a>.)</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/draw-attention-with-mark/" rel="bookmark" class="crp_title">Draw attention with mark</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/html-5-boilerplates/" rel="bookmark" class="crp_title">HTML5 Boilerplates</a></li>
<li><a href="http://html5doctor.com/native-drag-and-drop/" rel="bookmark" class="crp_title">Native Drag and Drop</a></li>
<li><a href="http://html5doctor.com/the-time-element/" rel="bookmark" class="crp_title">The time element (and microformats)</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=%22Block-level%22%20links%20in%20HTML5%20-%20http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5&amp;bodytext=One%20new%20and%20exciting%20thing%20you%20can%20do%20in%20HTML%205%20is%20wrap%20links%20round%20%22block-level%22%20elements.%20Find%20out%20how%20this%20works%2C%20why%20it%20works%20with%20true-life%20sample%20code." 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%2Fblock-level-links-in-html-5%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5&amp;notes=One%20new%20and%20exciting%20thing%20you%20can%20do%20in%20HTML%205%20is%20wrap%20links%20round%20%22block-level%22%20elements.%20Find%20out%20how%20this%20works%2C%20why%20it%20works%20with%20true-life%20sample%20code." 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%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=%22Block-level%22%20links%20in%20HTML5&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;t=%22Block-level%22%20links%20in%20HTML5" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5&amp;annotation=One%20new%20and%20exciting%20thing%20you%20can%20do%20in%20HTML%205%20is%20wrap%20links%20round%20%22block-level%22%20elements.%20Find%20out%20how%20this%20works%2C%20why%20it%20works%20with%20true-life%20sample%20code." 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=%22Block-level%22%20links%20in%20HTML5&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;t=%22Block-level%22%20links%20in%20HTML5" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;title=%22Block-level%22%20links%20in%20HTML5&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=One%20new%20and%20exciting%20thing%20you%20can%20do%20in%20HTML%205%20is%20wrap%20links%20round%20%22block-level%22%20elements.%20Find%20out%20how%20this%20works%2C%20why%20it%20works%20with%20true-life%20sample%20code." 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%2Fblock-level-links-in-html-5%2F&amp;h=%22Block-level%22%20links%20in%20HTML5" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fblock-level-links-in-html-5%2F&amp;t=%22Block-level%22%20links%20in%20HTML5&amp;s=One%20new%20and%20exciting%20thing%20you%20can%20do%20in%20HTML%205%20is%20wrap%20links%20round%20%22block-level%22%20elements.%20Find%20out%20how%20this%20works%2C%20why%20it%20works%20with%20true-life%20sample%20code." 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/block-level-links-in-html-5/" rel="bookmark">&#8220;Block-level&#8221; links in HTML5</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 13, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/block-level-links-in-html-5/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>HTML 5 + XML = XHTML 5</title>
		<link>http://html5doctor.com/html-5-xml-xhtml-5/</link>
		<comments>http://html5doctor.com/html-5-xml-xhtml-5/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:20:41 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[Structure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[XHTML 5]]></category>
		<category><![CDATA[xml]]></category>

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