<?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; Elements</title>
	<atom:link href="http://html5doctor.com/category/elements/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>You can still use div</title>
		<link>http://html5doctor.com/you-can-still-use-div/</link>
		<comments>http://html5doctor.com/you-can-still-use-div/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 13:30:37 +0000</pubDate>
		<dc:creator>Mike Robinson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[semantics]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1853</guid>
		<description><![CDATA[
			
				
			
		
&#8220;Sorry, can you say that again?&#8221;, I hear you ask. Certainly: you can still use &#60;div&#62;! Despite HTML5 bringing us new elements like &#60;article&#62;, &#60;section&#62;, and &#60;aside&#62;, the &#60;div&#62; element still has its place. Let the HTML5 Doctor tell you why.

Status: Unchanged
In HTML 4, the &#60;div&#62; element was defined to be a generic element for [...]]]></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%2Fyou-can-still-use-div%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fyou-can-still-use-div%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>&#8220;Sorry, can you say that again?&#8221;, I hear you ask. Certainly: you can still use <code>&lt;div&gt;</code>! Despite <abbr title="HyperText Markup Language">HTML</abbr>5 bringing us new elements like <code>&lt;article&gt;</code>, <code>&lt;section&gt;</code>, and <code>&lt;aside&gt;</code>, the <code>&lt;div&gt;</code> element still has its place. Let the <abbr>HTML</abbr>5 Doctor tell you why.</p>
<p><span id="more-1853"></span></p>
<h2>Status: Unchanged</h2>
<p>In <abbr>HTML</abbr> 4, the <code>&lt;div&gt;</code> element was defined to be a generic element for structuring a page. Although you can allude to the nature of its content by assigning <code>id</code> and <code>class</code> attributes with meaningful names, a <code>&lt;div&gt;</code> has almost no semantic meaning. <a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">The <abbr>HTML</abbr>5 definition</a>is basically the same as in <abbr>HTML</abbr> 4:</p>
<blockquote>
<p>The div element has no special meaning at all. It represents its children. It can be used with the class, lang, and title attributes to mark up semantics common to a group of consecutive elements.</p>
<p>  <footer><br />
    <cite><a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">W3C Specification</a></cite><br />
  </footer>
</p></blockquote>
<p><code>&lt;div&gt;</code> is literally a container for flow content*, a collection of (hopefully) more semantically marked-up content that may need to be grouped together. It lies at the opposite end of the semantic spectrum from the new <abbr>HTML</abbr>5 structural elements.</p>
<p><small>* For those who haven&#8217;t encountered this term before, <a href="http://dev.w3.org/html5/spec/Overview.html#flow-content-0">flow content</a> elements are the same as <abbr>HTML</abbr> 4&#8217;s block-level content elements.</small></p>
<h2><code>&lt;div&gt;</code> vs semantic elements</h2>
<p>The new semantic elements (<code>&lt;article&gt;</code>, <code>&lt;section&gt;</code>, and friends) justifiably capture a lot of <code>&lt;div&gt;</code>&#8217;s territory, but <code>&lt;div&gt;</code> still has a place in the <abbr>HTML</abbr>5 world. You should use <code>&lt;div&gt;</code> when there is no other more semantically appropriate element that suits your purpose. Its most common use will likely be for stylistic purposes — i.e., wrapping some semantically marked-up content in a <abbr>CSS</abbr>-styled container.</p>
<p>Ask yourself questions about your content: Is it part of the site&#8217;s navigation? Is the content secondary to its surrounding content? If this content were printed on a page with nothing else, would it make sense? You will need to evaluate your content carefully, thinking about what it is and pairing it with an appropriate element. I recommend taking a look at <a href="http://html5doctor.com/happy-1st-birthday-us/">The Amazing <abbr>HTML</abbr>5 Doctor Easily Confused <abbr>HTML</abbr>5 Element Flowchart of Enlightenment</a> to help you choose the right element for your flow content.</p>
<h2>Example Uses</h2>
<p>Below are a few examples of how you can still use <code>&lt;div&gt;</code> appropriately in your <abbr>HTML</abbr>5 sites.</p>
<h3>Site Wrapper</h3>
<p>While you can <a href="http://camendesign.com/code/developpeurs_sans_frontieres">use the <code>&lt;body&gt; element</code></a> as a &#8220;natural&#8221; wrapper for site content, many people like to use <code>&lt;div&gt;</code> as top-level container for styling the entire site. This is an appropriate use of <code>&lt;div&gt;</code>, as a site wrapper has no meaning or purpose other than to aid styling.</p>
<pre><code>&lt;body&gt;
  &lt;div id="wrapper"&gt;
    &lt;header&gt;
      &lt;h1&gt;My Happy Blog&lt;/h1&gt;
      &lt;nav&gt;
        &lt;!-- ... --&gt;
      &lt;/nav&gt;
    &lt;/header&gt;

    &lt;!-- ... rest of site content ... --&gt;
  &lt;/div&gt;
&lt;/body&gt;</code></pre>
<h3>Intro paragraph</h3>
<p>If you want to style a particular block of content, like the intro to an article, <code>&lt;div&gt;</code> is a perfectly suitable element:</p>
<pre><code>&lt;article&gt;
  &lt;h1&gt;Big announcement&lt;/h1&gt;
  &lt;div class="intro"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
    &lt;p&gt;Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.&lt;/p&gt;
  &lt;/div&gt;
  &lt;p&gt;Sed massa metus, molestie nec facilisis non, lobortis ac orci. Suspendisse porttitor laoreet mi, at laoreet dolor rhoncus non. Sed ut massa quis mi placerat iaculis non sit amet odio. Cras tempus urna vitae felis rutrum porta.&lt;/p&gt;
  &lt;p&gt;Maecenas auctor lacus eget mauris tincidunt consectetur. Donec molestie malesuada ligula, sed feugiat massa consequat sit amet. Pellentesque orci metus, ultricies sit amet adipiscing eget, gravida fringilla dui. Vestibulum accumsan dui diam, eget venenatis urna. Sed eu lobortis justo. Aliquam erat volutpat. Aliquam erat volutpat.&lt;/p&gt;
&lt;/article&gt;</code></pre>
<p>The first two paragraphs aren&#8217;t really that different from the rest of the article, but by wrapping them in a <code>&lt;div&gt;</code>, they can be styled to capture the reader&#8217;s attention and draw them into the article. Of course, if you only want to style the first paragraph, you could use a <abbr>CSS</abbr> selector like <code>h1 + p {}</code> or <code>article p:first-child {}</code>. But if you want to style an article&#8217;s first paragraph only <em>sometimes</em>, or you need the style to work in older versions of Internet Explorer, or (as in this case) you want style more than one paragraph, a wrapper <code>&lt;div&gt;</code> is the way to go.</p>
<h3>Other uses for <code>&lt;div&gt;</code></h3>
<p>As previously stated, use of <code>&lt;div&gt;</code> will decline in favour of the new semantic elements. If you&#8217;re using lots of <code>&lt;div&gt;</code>s and only a few of the semantic elements in your <abbr>HTML</abbr>5 sites, then you&#8217;re really not taking advantage of what <abbr>HTML</abbr>5 has to offer.</p>
<p>That said, you may need to rely on <code>&lt;div&gt;</code> as you transition into the world of <abbr>HTML</abbr>5. For example, if many of your site&#8217;s visitors use Internet Explorer with JavaScript disabled, then you won&#8217;t be able to style the new elements for these users. A piece of advice we gave back in our article on <a href="http://html5doctor.com/how-to-use-html5-in-your-client-work-right-now/">how to use <abbr>HTML</abbr>5 in your client work right now</a> was to use <code>&lt;div&gt;</code> with classes named after the new semantic elements, getting you to think about how you would use the new semantic elements without actually using them.</p>
<pre><code>&lt;div class="article"&gt;
  &lt;div class="header"&gt;
    &lt;h1&gt;My blog post&lt;/h1&gt;
    &lt;p&gt;An example using divs with classes instead of the new elements.&lt;/p&gt;
  &lt;/div&gt;
  &lt;!-- ... content ... --&gt;
&lt;/div&gt;

&lt;article&gt;
  &lt;header&gt;
    &lt;h1&gt;My blog post&lt;/h1&gt;
    &lt;p&gt;The same article but switched to the new elements.&lt;/p&gt;
  &lt;/header&gt;
  &lt;!-- ... content ... --&gt;
&lt;/article&gt;</code></pre>
<p>This makes it simple to switch to the new elements when it becomes practical (think &#8220;search and replace&#8221;).</p>
<h2>Recap</h2>
<p>You will certainly use <code>&lt;div&gt;</code> less often in <abbr>HTML</abbr>5 than you did in <abbr>HTML</abbr> 4, but it&#8217;s still a valuable element to have in your toolkit. Sure, it&#8217;ll be picked last for the team because everyone else is better, but it&#8217;ll be the best damn generic container element there is!*</p>
<p>Look at the more semantically valuable elements and consider whether your content would benefit from what they offer. Need help deciding? Take a look at some of these articles right here on <abbr>HTML</abbr>5 Doctor:</p>
<ul>
<li><a href="http://html5doctor.com/the-header-element/">header</a></li>
<li><a href="http://html5doctor.com/the-footer-element/">footer</a></li>
<li><a href="http://html5doctor.com/aside-revisited/">aside</a></li>
<li><a href="http://html5doctor.com/the-article-element/">article</a></li>
<li><a href="http://html5doctor.com/the-section-element/">section</a></li>
<li><a href="http://html5doctor.com/the-figure-figcaption-elements/">figure</a></li>
<li><a href="http://html5doctor.com/nav-element/">nav</a></li>
</ul>
<p>For more, check our <a href="http://html5doctor.com/article-archive/">article archive</a>. And if all else fails, use a <code>&lt;div&gt;</code>!</p>
<p><small>* As it should be, it&#8217;s the only one apart from <code>&lt;span&gt;</code>. That said, if your content is just text, perhaps the oft-overlooked <code>&lt;p&gt;</code> would be more appropriate.</small>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<li><a href="http://html5doctor.com/understanding-aside/" rel="bookmark" class="crp_title">Understanding aside</a></li>
<li><a href="http://html5doctor.com/aside-revisited/" rel="bookmark" class="crp_title">Aside Revisited</a></li>
<li><a href="http://html5doctor.com/the-hgroup-element/" rel="bookmark" class="crp_title">The hgroup element</a></li>
<li><a href="http://html5doctor.com/the-header-element/" rel="bookmark" class="crp_title">The header element</a></li>
<li><a href="http://html5doctor.com/the-section-element/" rel="bookmark" class="crp_title">The section element</a></li>
</ul>
</div>
<p>Share and Save:</p>
<p>	<a rel="nofollow"  href="http://twitter.com/home?status=You%20can%20still%20use%20div%20-%20http%3A%2F%2Fhtml5doctor.com%2Fyou-can-still-use-div%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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div&amp;bodytext=%22Sorry%2C%20can%20you%20say%20that%20again%3F%22%2C%20I%20hear%20you%20ask.%20Certainly%3A%20you%20can%20still%20use%20%26lt%3Bdiv%26gt%3B%21%20Despite%20HTML5%20bringing%20us%20new%20elements%20like%20%26lt%3Barticle%26gt%3B%2C%20%26lt%3Bsection%26gt%3B%2C%20and%20%26lt%3Baside%26gt%3B%2C%20the%20%26lt%3Bdiv%26gt%3B%20element%20still%20has%20its%20place.%20Let%20the%20HTML5%20Do" 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%2Fyou-can-still-use-div%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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div" 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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div&amp;notes=%22Sorry%2C%20can%20you%20say%20that%20again%3F%22%2C%20I%20hear%20you%20ask.%20Certainly%3A%20you%20can%20still%20use%20%26lt%3Bdiv%26gt%3B%21%20Despite%20HTML5%20bringing%20us%20new%20elements%20like%20%26lt%3Barticle%26gt%3B%2C%20%26lt%3Bsection%26gt%3B%2C%20and%20%26lt%3Baside%26gt%3B%2C%20the%20%26lt%3Bdiv%26gt%3B%20element%20still%20has%20its%20place.%20Let%20the%20HTML5%20Do" 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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div" 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%2Fyou-can-still-use-div%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=You%20can%20still%20use%20div&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fyou-can-still-use-div%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%2Fyou-can-still-use-div%2F&amp;t=You%20can%20still%20use%20div" 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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div&amp;annotation=%22Sorry%2C%20can%20you%20say%20that%20again%3F%22%2C%20I%20hear%20you%20ask.%20Certainly%3A%20you%20can%20still%20use%20%26lt%3Bdiv%26gt%3B%21%20Despite%20HTML5%20bringing%20us%20new%20elements%20like%20%26lt%3Barticle%26gt%3B%2C%20%26lt%3Bsection%26gt%3B%2C%20and%20%26lt%3Baside%26gt%3B%2C%20the%20%26lt%3Bdiv%26gt%3B%20element%20still%20has%20its%20place.%20Let%20the%20HTML5%20Do" 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=You%20can%20still%20use%20div&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fyou-can-still-use-div%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%2Fyou-can-still-use-div%2F&amp;t=You%20can%20still%20use%20div" 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%2Fyou-can-still-use-div%2F&amp;title=You%20can%20still%20use%20div&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=%22Sorry%2C%20can%20you%20say%20that%20again%3F%22%2C%20I%20hear%20you%20ask.%20Certainly%3A%20you%20can%20still%20use%20%26lt%3Bdiv%26gt%3B%21%20Despite%20HTML5%20bringing%20us%20new%20elements%20like%20%26lt%3Barticle%26gt%3B%2C%20%26lt%3Bsection%26gt%3B%2C%20and%20%26lt%3Baside%26gt%3B%2C%20the%20%26lt%3Bdiv%26gt%3B%20element%20still%20has%20its%20place.%20Let%20the%20HTML5%20Do" 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%2Fyou-can-still-use-div%2F&amp;h=You%20can%20still%20use%20div" 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%2Fyou-can-still-use-div%2F&amp;t=You%20can%20still%20use%20div&amp;s=%22Sorry%2C%20can%20you%20say%20that%20again%3F%22%2C%20I%20hear%20you%20ask.%20Certainly%3A%20you%20can%20still%20use%20%26lt%3Bdiv%26gt%3B%21%20Despite%20HTML5%20bringing%20us%20new%20elements%20like%20%26lt%3Barticle%26gt%3B%2C%20%26lt%3Bsection%26gt%3B%2C%20and%20%26lt%3Baside%26gt%3B%2C%20the%20%26lt%3Bdiv%26gt%3B%20element%20still%20has%20its%20place.%20Let%20the%20HTML5%20Do" 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/you-can-still-use-div/" rel="bookmark">You can still use div</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 13, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/you-can-still-use-div/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Video: the track element and webM codec</title>
		<link>http://html5doctor.com/video-the-track-element-and-webm-codec/</link>
		<comments>http://html5doctor.com/video-the-track-element-and-webm-codec/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 13:45:42 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[track]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[webm]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=2089</guid>
		<description><![CDATA[There are a couple of interesting developments in the world of HTML5 multimedia that you'll be interested in&#8212;the webM video format, and a proposed solution to HTML5 multimedia accessibility.]]></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%2Fvideo-the-track-element-and-webm-codec%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>There are a couple of interesting developments in the world of <abbr>HTML</abbr>5 multimedia that you&#8217;ll be interested in. The first is the new <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-track-element"><code>&lt;track&gt;</code> element</a> (currently only in the WHAT-WG spec due to political stuff).</p>

<p><code>&lt;track&gt;</code> is a child of a <code>&lt;video&gt;</code> or <code>&lt;audio&gt;</code> element that links to a <b>timed track</b>, or time-based data. The kind of data is set via a <code>kind</code> attribute, which can take values of <code>subtitles</code>, <code>captions</code>, <code>descriptions</code>, <code>chapters</code> or <code>metadata</code>, depending on the type of information you&#8217;re adding to your media. These point to a source file containing timed text that the browser will expose via some kind of user interface, if the visitor requires additional data.</p>

<p>This will allow for &#8220;write once, use everywhere&#8221; accessibility; anyone linking to that file with a <code>&lt;video&gt;</code> or <code>&lt;audio&gt;</code> element that includes the element can access your information.</p>

<pre><code>&lt;track kind=captions src=blah.srt&gt;</code></pre>

<p>The file format is a new format called <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#websrt">WebSRT</a>, which competes with about <a href="http://wiki.whatwg.org/wiki/Timed_track_formats">50 other timed formats</a>, including some W3C formats (hence the omission of <code>&lt;track&gt;</code> from the W3C spec).</p><p>Added 9 July 2010: Here&#8217;s a readable <a href="http://www.delphiki.com/websrt/">overview of the SRT format</a>.</p>

<p>Given that the format itself isn&#8217;t fully specified yet, it will be a while until we see implementation in browsers. But it&#8217;s good to know that there will be an official way to add accessibility information to media. Until then, I have a <a href="http://dev.opera.com/articles/view/accessible-html5-video-with-javascripted-captions/">JavaScript hack</a> to take timed <code>&lt;span&gt;</code>s out of an in-page transcript to superimpose over a video.</p>

<h2>WebM video format</h2>
<p>The big news of the last month is that Google open-sourced the VP8 video codec that it acquired when it <a href="http://investor.google.com/releases/2010/0219.html">took over On2 Technologies</a>. When combined with the Vorbis audio codec (that Spotify uses) and wrapped in a subset of the <a href="http://en.wikipedia.org/wiki/Matroska">Matroska container format</a>, it&#8217;s collectively known as <a href="http://www.webmproject.org/">WebM</a>.</p>

<p>All YouTube videos are being transcoded to WebM, and Adobe have also announced they will include it in their Flash player. It&#8217;s available in an <a href="http://www.opera.com/browser/next">Opera 10.60 beta</a>, a <a href="http://nightly.mozilla.org/webm/">Firefox testing build</a>, and a <a href="http://www.chromium.org/getting-involved/dev-channel">Chromium dev channel</a>. Even Microsoft have said that IE9 will support it if the codec is installed on the computer.</p>

<p>The <a href="http://www.streamingmedia.com/Articles/Editorial/Featured-Articles/First-Look-H.264-and-VP8-Compared-67266.aspx">VP8 video codec itself is high-quality</a> (Google had said that Ogg Theora wasn&#8217;t good enough compression-to-quality for YouTube, but Theora was based on the VP3 precursor to VP8). It&#8217;s available for <a href="http://zaheer.merali.org/articles/2010/06/02/webm-and-vp8-streaming-live-from-flumotion/">streaming</a> too.</p>

<p>If you want to encode to WebM, you can try the <a href="http://www.mirovideoconverter.com/">Miro Video Converter</a> utility. Although it doesn&#8217;t allow you to optimise settings, it&#8217;s very easy to use. As the codec becomes more widespread, expect to see many more tools for content creation, editing, and transcoding.</p>

<p>Once production versions of the browsers are available, you should encode your videos with WebM as the first option, Ogg for older versions of Opera, Firefox and Chrome, falling back to royalty-encumbered H.264 for Safari and links to downloads or a Flash player for legacy browsers:</p>

<pre><code>&lt;video controls&gt;
&lt;source src=video.webm type='video/webm; codecs="vorbis,vp8"'&gt;
&lt;source src=video.mp4 type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'&gt;
&lt;source src=video.ogv type='video/ogg; codecs="theora, vorbis"'&gt;
&lt;!-- embed Flash here --&gt;
&lt;p&gt;Your browser does not support video; download the &lt;a href=&quot;video.webm&quot;&gt;WebM&lt;/a&gt;, &lt;a href=&quot;video.mp4&quot;&gt;mp4&lt;/a&gt; or &lt;a href=&quot;video.ogg&quot;&gt;Ogg&lt;/a&gt; video for off-line viewing.&lt;/p&gt;
&lt;/video&gt;</code>
</pre>

<p>If, however, you&#8217;re having problems with the iPad, put the MP4 version first in the <code>&lt;source&gt;</code> element; apparently there&#8217;s a bug that causes the iPad only to see the first <code>&lt;source&gt;</code> element.</p>

<p>It’s a long haul, and it’s not over yet, but <code>&lt;track&gt;</code> and .webM show significant progress towards our goal of accessible, open, and royalty-free video playing natively in the browser.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><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/the-video-element/" rel="bookmark" class="crp_title">The video element</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-8/" rel="bookmark" class="crp_title">Your Questions Answered #8</a></li><li><a href="http://html5doctor.com/your-questions-answered-1/" rel="bookmark" class="crp_title">Your questions answered #1</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=Video%3A%20the%20track%20element%20and%20webM%20codec%20-%20http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;bodytext=There%20are%20a%20couple%20of%20interesting%20developments%20in%20the%20world%20of%20HTML5%20multimedia%20that%20you%27ll%20be%20interested%20in%26mdash%3Bthe%20webM%20video%20format%2C%20and%20a%20proposed%20solution%20to%20HTML5%20multimedia%20accessibility." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;notes=There%20are%20a%20couple%20of%20interesting%20developments%20in%20the%20world%20of%20HTML5%20multimedia%20that%20you%27ll%20be%20interested%20in%26mdash%3Bthe%20webM%20video%20format%2C%20and%20a%20proposed%20solution%20to%20HTML5%20multimedia%20accessibility." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;t=Video%3A%20the%20track%20element%20and%20webM%20codec" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;annotation=There%20are%20a%20couple%20of%20interesting%20developments%20in%20the%20world%20of%20HTML5%20multimedia%20that%20you%27ll%20be%20interested%20in%26mdash%3Bthe%20webM%20video%20format%2C%20and%20a%20proposed%20solution%20to%20HTML5%20multimedia%20accessibility." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;t=Video%3A%20the%20track%20element%20and%20webM%20codec" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;title=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=There%20are%20a%20couple%20of%20interesting%20developments%20in%20the%20world%20of%20HTML5%20multimedia%20that%20you%27ll%20be%20interested%20in%26mdash%3Bthe%20webM%20video%20format%2C%20and%20a%20proposed%20solution%20to%20HTML5%20multimedia%20accessibility." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;h=Video%3A%20the%20track%20element%20and%20webM%20codec" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fvideo-the-track-element-and-webm-codec%2F&amp;t=Video%3A%20the%20track%20element%20and%20webM%20codec&amp;s=There%20are%20a%20couple%20of%20interesting%20developments%20in%20the%20world%20of%20HTML5%20multimedia%20that%20you%27ll%20be%20interested%20in%26mdash%3Bthe%20webM%20video%20format%2C%20and%20a%20proposed%20solution%20to%20HTML5%20multimedia%20accessibility." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/video-the-track-element-and-webm-codec/" rel="bookmark">Video: the track element and webM codec</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 24, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/video-the-track-element-and-webm-codec/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>The dl element</title>
		<link>http://html5doctor.com/the-dl-element/</link>
		<comments>http://html5doctor.com/the-dl-element/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:00:10 +0000</pubDate>
		<dc:creator>Mike Robinson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[dd]]></category>
		<category><![CDATA[dl]]></category>
		<category><![CDATA[dt]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

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

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

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


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20article%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;bodytext=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;notes=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20article%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;t=The%20article%20element" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;annotation=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20article%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;t=The%20article%20element" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;title=The%20article%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;h=The%20article%20element" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fthe-article-element%2F&amp;t=The%20article%20element&amp;s=We%E2%80%99ve%20discussed%20a%20lot%20of%20new%20elements%20here%20at%20HTML5Doctor%2C%20but%20the%20article%20element%20has%20somehow%20escaped%20the%20microscope%E2%80%A6%20until%20now%21%20article%20is%20one%20of%20the%20new%20sectioning%20elements.%20It%20is%20often%20confused%20with%20section%20and%20div%20but%20don%27t%20worry%20we%27ll%20explain%20the%20difference%20between%20them." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/the-article-element/" rel="bookmark">The article element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 18, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-article-element/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>The ruby element and her hawt friends, rt and rp</title>
		<link>http://html5doctor.com/ruby-rt-rp-element/</link>
		<comments>http://html5doctor.com/ruby-rt-rp-element/#comments</comments>
		<pubDate>Tue, 11 May 2010 14:00:55 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[rp]]></category>
		<category><![CDATA[rt]]></category>
		<category><![CDATA[ruby]]></category>

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


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp%20-%20http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;bodytext=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;notes=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;annotation=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;title=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;h=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fruby-rt-rp-element%2F&amp;t=The%20ruby%20element%20and%20her%20hawt%20friends%2C%20rt%20and%20rp&amp;s=The%20%26lt%3Bruby%26gt%3B%2C%20%26lt%3Brt%26gt%3B%20and%20%26lt%3Brp%26gt%3B%20elements%20allow%20us%20to%20add%20%E2%80%98ruby%E2%80%99%20phonetic%20annotations%20in%20languages%20like%20Japanese%20and%20Chinese.%20Despite%20the%20terrors%20of%20internationalisation%20and%20patchy%20browser%20support%20%E2%80%94%20with%20a%20little%20fiddling%20and%20a%20lot%20of%20caution%20%E2%80%94%20this%20sexy%20threesome%20with%20adorable%20accents%20are%20ready%20to%20use%20now." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/ruby-rt-rp-element/" rel="bookmark">The ruby element and her hawt friends, rt and rp</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on May 11, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/ruby-rt-rp-element/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The figure &amp; figcaption elements</title>
		<link>http://html5doctor.com/the-figure-figcaption-elements/</link>
		<comments>http://html5doctor.com/the-figure-figcaption-elements/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 13:45:20 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[aside]]></category>
		<category><![CDATA[figcaption]]></category>
		<category><![CDATA[figure]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

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


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20figure%20%26%20figcaption%20elements%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;bodytext=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;notes=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20figure%20%26%20figcaption%20elements&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;annotation=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20figure%20%26%20figcaption%20elements&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;title=The%20figure%20%26%20figcaption%20elements&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;h=The%20figure%20%26%20figcaption%20elements" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fthe-figure-figcaption-elements%2F&amp;t=The%20figure%20%26%20figcaption%20elements&amp;s=In%20traditional%20printed%20material%20like%20books%20and%20magazines%2C%20an%20image%2C%20chart%2C%20or%20code%20example%20would%20be%20accompanied%20by%20a%20caption.%20Before%20now%2C%20we%20didn%27t%20have%20a%20way%20of%20semantically%20marking%20up%20this%20sort%20of%20content%20directly%20in%20our%20HTML%2C%20instead%20resorting%20to%20CSS%20class%20names.%20HTML5%20hopes%20to%20solve%20that%20problem%20by%20introducing%20the%20%26lt%3Bfigure%26gt%3B%20and%20%26lt%3Bfigcaption%26gt%3B%20elements.%20Let%27s%20explore%21" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/the-figure-figcaption-elements/" rel="bookmark">The figure &#038; figcaption elements</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 13, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-figure-figcaption-elements/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>The nsfw element</title>
		<link>http://html5doctor.com/the-nsfw-element/</link>
		<comments>http://html5doctor.com/the-nsfw-element/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 07:30:20 +0000</pubDate>
		<dc:creator>Bruce Lawson</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[nsfw]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1689</guid>
		<description><![CDATA[Among the new semantic elements for section, footer, header and the like, HTML5 also adds an element that can contain any other element and describes it as Not Safe For Work (commonly abbreviated to "nsfw"). ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" /><br />
			</a>
		</div>
<p>Among the new semantic elements for section, footer, header, and the like, <abbr>HTML</abbr>5 also adds an element that can contain any other element and describes it as Not Safe For Work (commonly abbreviated to &#8220;nsfw&#8221;).</p>
<p>Browsers can be configured by parents or workplace sysadmins never to show content marked as <code>&lt;nsfw&gt;</code>, thereby shielding faint-hearted people from obscenity and protecting employers from employees downloading things they shouldn&#8217;t.</p>
<p>It&#8217;s not just a presentational element, although it does carry with it the default <abbr>CSS</abbr>:</p>
<pre><code>nsfw { display: none; }</code></pre>
<p>The user agent is forbidden from downloading any of the resources contained within the element if the browser&#8217;s <code>&lt;nsfw&gt;</code> setting is &#8220;on&#8221;.</p>
<p>It works like this:</p>
<pre><code>&lt;nsfw&gt;
 &lt;figure&gt;
 &lt;video src="chickens.ogv" autoplay&gt;
 &lt;/video&gt;
 &lt;figcaption&gt;Huge cockerel: two chicks, one coop.&lt;/figcaption&gt;
 &lt;/figure&gt;
&lt;/nsfw&gt;</code></pre>
<p>The entire figure is taken out of the document flow with no indication to the user that something is missing (which could tempt teenagers to circumvent the browser setting). Although the video is set to autoplay, it will never even be downloaded, meaning nothing compromising will be in the user&#8217;s cache.</p>
<p>The new element was suggested by Ian Hickson, the editor of the <abbr>HTML</abbr>5 spec and Google employee: &#8220;Google builds a separate index for those who search using <a href="http://www.google.com/support/websearch/bin/answer.py?hl=en&amp;answer=510">Google SafeSearch</a>. Given that 72.3% of the Web is not safe for work but we currently have to analyse that using machines, semantically marked-up porn and foul language will dramatically reduce the time it takes to build our index, enhance its accuracy and, most importantly, protect little children.&#8221;</p>
<p>So far, it is not implemented in any browser, although in its recent <a href="http://ie.microsoft.com/testdrive/"><abbr>IE</abbr>9 announcement</a>, Microsoft confirmed that <abbr>IE</abbr>9 and its Bing search engine will use a Microsoft-only extension <code>&lt;xxx&gt;</code> instead of the standard <code>&lt;nsfw&gt;</code>.</p>
<div id="crp_related">
<h3>Related Posts:</h3>
<ul>
<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/the-video-element/" rel="bookmark" class="crp_title">The video element</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/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</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=The%20nsfw%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element&amp;bodytext=Among%20the%20new%20semantic%20elements%20for%20section%2C%20footer%2C%20header%20and%20the%20like%2C%20HTML5%20also%20adds%20an%20element%20that%20can%20contain%20any%20other%20element%20and%20describes%20it%20as%20Not%20Safe%20For%20Work%20%28commonly%20abbreviated%20to%20%22nsfw%22%29.%20" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element&amp;notes=Among%20the%20new%20semantic%20elements%20for%20section%2C%20footer%2C%20header%20and%20the%20like%2C%20HTML5%20also%20adds%20an%20element%20that%20can%20contain%20any%20other%20element%20and%20describes%20it%20as%20Not%20Safe%20For%20Work%20%28commonly%20abbreviated%20to%20%22nsfw%22%29.%20" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20nsfw%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;t=The%20nsfw%20element" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element&amp;annotation=Among%20the%20new%20semantic%20elements%20for%20section%2C%20footer%2C%20header%20and%20the%20like%2C%20HTML5%20also%20adds%20an%20element%20that%20can%20contain%20any%20other%20element%20and%20describes%20it%20as%20Not%20Safe%20For%20Work%20%28commonly%20abbreviated%20to%20%22nsfw%22%29.%20" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20nsfw%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;t=The%20nsfw%20element" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;title=The%20nsfw%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Among%20the%20new%20semantic%20elements%20for%20section%2C%20footer%2C%20header%20and%20the%20like%2C%20HTML5%20also%20adds%20an%20element%20that%20can%20contain%20any%20other%20element%20and%20describes%20it%20as%20Not%20Safe%20For%20Work%20%28commonly%20abbreviated%20to%20%22nsfw%22%29.%20" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;h=The%20nsfw%20element" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a><br />
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fthe-nsfw-element%2F&amp;t=The%20nsfw%20element&amp;s=Among%20the%20new%20semantic%20elements%20for%20section%2C%20footer%2C%20header%20and%20the%20like%2C%20HTML5%20also%20adds%20an%20element%20that%20can%20contain%20any%20other%20element%20and%20describes%20it%20as%20Not%20Safe%20For%20Work%20%28commonly%20abbreviated%20to%20%22nsfw%22%29.%20" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a></p>
<p><br/><br/></p>
<p><a href="http://html5doctor.com/the-nsfw-element/" rel="bookmark">The nsfw element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on April 1, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-nsfw-element/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>The hgroup element</title>
		<link>http://html5doctor.com/the-hgroup-element/</link>
		<comments>http://html5doctor.com/the-hgroup-element/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 15:45:12 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[hgroup]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1052</guid>
		<description><![CDATA[<p>One of the new elements defined in <abbr>HTML</abbr>5 is <code>&#60;hgroup&#62;</code>, used for grouping titles with their associated subtitles. But why do we need <code>&#60;hgroup&#62;</code> when we've already got the <code>&#60;header&#62;</code> element? In this article, we'll do our best to answer that question.</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>One of the new elements defined in <abbr>HTML</abbr>5 is <code>&lt;hgroup&gt;</code>, used for grouping titles with their associated subtitles. But why do we need <code>&lt;hgroup&gt;</code> when we&#8217;ve already got the <code>&lt;header&gt;</code> element? In this article, we&#8217;ll do our best to answer that question.</p>

<h2>What is the <code>&lt;hgroup&gt;</code> element?</h2>
<p>Here&#8217;s what the spec says about <code>&lt;hgroup&gt;</code>:</p>
<blockquote><p>The hgroup element is typically used to group a set of one or more h1-h6 elements — to group, for example, a section title and an accompanying subtitle.</p><footer><cite><a href="http://dev.w3.org/html5/markup/hgroup.html">W3C Specification</a></cite></footer></blockquote>

<h3>So what does that mean?</h3>
<p><code>&lt;hgroup&gt;</code> acts as a wrapper for <del>two</del> one or more related heading elements possibly contained within a <code>&lt;header&gt;</code> element. It can <em>only</em> contain a group of <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code> element(s), and it should be used for subtitles, alternative titles, and tag lines.</p>

<p>The easiest way to demonstrate proper use of <code>&lt;hgroup&gt;</code> is through some examples. Thanks to <a href="http://twitter.com/boblet">Dr. Oli</a> for letting us use <a href="http://oli.jp/2009/html5-structure2/">his examples</a>.</p>

<h3>An article with one title</h3>
<p>The title consists of a single <code>&lt;h1&gt;</code>, so neither <code>&lt;hgroup&gt;</code> nor <code>&lt;header&gt;</code> is required:</p>
<pre><code>&lt;article&gt;
  &lt;h1&gt;Title goes here&lt;/h1&gt;
  &lt;p&gt;Lorem Ipsum dolor set amet&lt;/p&gt;
&lt;/article&gt;</code></pre>

<h3>An article with a title and metadata</h3>
<p>Here we&#8217;re using <code>&lt;header&gt;</code> to group the title and associated metadata, so an <code>&lt;hgroup&gt;</code> is not required:</p>
<pre><code>&lt;article&gt;
  &lt;header&gt;
    &lt;h1&gt;Title goes here&lt;/h1&gt;
    &lt;p&gt;&lt;time datetime="2010-03-20"&gt;20th March, 2010&lt;/time&gt;&lt;/p&gt;
  &lt;/header&gt;
  &lt;p&gt;Lorem Ipsum dolor set amet&lt;/p&gt;
&lt;/article&gt;</code></pre>

<h3>An article with a title and subtitle</h3>
<p>An <code>&lt;hgroup&gt;</code> contains the title and subtitle of the article:</p>
<pre><code>&lt;article&gt;
  &lt;hgroup&gt;
    &lt;h1&gt;Title goes here&lt;/h1&gt;
    &lt;h2&gt;Subtitle of article&lt;/h2&gt;
  &lt;/hgroup&gt;
  &lt;p&gt;Lorem Ipsum dolor set amet&lt;/p&gt;
&lt;/article&gt;</code></pre>

<h3>An article with a title, subtitle and metadata</h3>
<p>An <code>&lt;hgroup&gt;</code> contains the title and subtitle of the article, and then a <code>&lt;header&gt;</code> contains the metadata and the <code>&lt;hgroup&gt;</code>:</p>
<pre><code>&lt;article&gt;
  &lt;header&gt;
    &lt;hgroup&gt;
      &lt;h1&gt;Title goes here&lt;/h1&gt;
      &lt;h2&gt;Subtitle of article&lt;/h2&gt;
    &lt;/hgroup&gt;
    &lt;p&gt;&lt;time datetime="2010-03-20"&gt;20th March, 2010&lt;/time&gt;&lt;/p&gt;
  &lt;/header&gt;                
  &lt;p&gt;Lorem Ipsum dolor set amet&lt;/p&gt;
&lt;/article></code></pre>


<h3>Real world examples</h3>
<p>On <a href="http://twitter.com/alex_gibson">Alex Gibson&#8217;s</a> <a href="http://miniapps.co.uk">MiniApps</a>, he uses <code>&lt;hgroup&gt;</code> to include a tag line after the main &#8220;MiniApps&#8221; heading. (This is also what we&#8217;ve done on this site if you view the source.)</p>

<figure>
	<img src="http://html5doctor.com/wp-content/uploads/2010/03/mini-apps-hgroup.jpg" alt="Screenshot from http://miniapps.co.uk" />
    <figcaption>Screenshot from Alex Gibson&#8217;s MiniApps site</figcaption>
</figure>

<h2>So why use <code>&lt;hgroup&gt;</code>?</h2>
<p>It&#8217;s all about the <em>document outline</em>. When grouping headings in an <code>&lt;hgroup&gt;</code> element, the outline algorithm will mask <del>the lowest level</del> <ins>all but the highest level</ins> heading in the group from the resulting document outline. Using MiniApps as an example again, in his markup (although this is simplified), Alex uses:</p>

<pre><code>&#60;header&#62;
  <mark>&#60;hgroup&#62;</mark>
    &#60;h1&#62;&#60;a href="/"&#62;Mini Apps&#60;/a&#62;&#60;/h1&#62;
    &#60;h2&#62;Web applications for iPhone, Android &#38; other mobile platforms&#60;/h2&#62;
  <mark>&#60;/hgroup&#62;</mark>
&#60;/header&#62;
</code></pre>

<p>The <code>&lt;hgroup&gt;</code> contains both <code>&lt;h1&gt;</code> and <code>&lt;h2&gt;</code> elements, but the <a href="http://gsnedders.html5.org/outliner/">outliner</a> only includes the <code>&lt;h1&gt;</code>. This is illustrated in the image below. (Please ignore the &#8220;untitled section&#8221; as well. This is caused by the <code>nav</code> element, and a change request has been submitted to address this.)</p>

<figure>
	<img src="http://html5doctor.com/wp-content/uploads/2010/03/mini-apps-outline.jpg" alt="The page outline from http://miniapps.co.uk" />
    <figcaption>Document outline of miniapps.co.uk</figcaption>
</figure>

<p>We&#8217;ll be covering document outlines in another article, so I won&#8217;t go into detail here. You can test your own pages in the <a href="http://gsnedders.html5.org/outliner/" title="HTML5 Outliner"><abbr>HTML</abbr>5 Outliner</a> to ensure that you’re using the heading elements within <code>&lt;hgroup&gt;</code> correctly.</p>

<h2>Summary</h2>
<p>In this article, we&#8217;ve demonstrated how to use the <code>&lt;hgroup&gt;</code> element effectively. To recap:</p>

<ul>
  <li>If you have a simple title with a single heading element (<code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code>), you do not need an <code>&lt;hgroup&gt;</code>.</li>
  <li>If you have a title with subtitle(s) or tag lines (i.e., more than one consecutive <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code>), group them in an <code>&lt;hgroup&gt;</code>.</li>
  <li>If you have a title with subtitle(s) <em>and</em> other metadata associated with the section or article, place both the <code>&lt;hgroup&gt;</code> and the metadata within a single <code>&lt;header&gt;</code> element.</li>
</ul>

<p><a href="/contact/" title="Contact us">Let us know</a> how you&#8217;re using <code>&lt;hgroup&gt;</code> in your <abbr>HTML</abbr>5 projects!</p><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/the-header-element/" rel="bookmark" class="crp_title">The header element</a></li><li><a href="http://html5doctor.com/your-questions-answered-7/" rel="bookmark" class="crp_title">Your Questions Answered #7</a></li><li><a href="http://html5doctor.com/your-questions-answered-6/" rel="bookmark" class="crp_title">Your Questions Answered #6</a></li><li><a href="http://html5doctor.com/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</a></li><li><a href="http://html5doctor.com/your-questions-5/" rel="bookmark" class="crp_title">Your Questions Answered #5</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20hgroup%20element%20-%20http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element&amp;bodytext=One%20of%20the%20new%20elements%20defined%20in%20HTML5%20is%20%26lt%3Bhgroup%26gt%3B%2C%20used%20for%20grouping%20titles%20with%20their%20associated%20subtitles.%20But%20why%20do%20we%20need%20%26lt%3Bhgroup%26gt%3B%20when%20we%27ve%20already%20got%20the%20%26lt%3Bheader%26gt%3B%20element%3F%20In%20this%20article%2C%20we%27ll%20do%20our%20best%20to%20answer%20that%20question." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element&amp;notes=One%20of%20the%20new%20elements%20defined%20in%20HTML5%20is%20%26lt%3Bhgroup%26gt%3B%2C%20used%20for%20grouping%20titles%20with%20their%20associated%20subtitles.%20But%20why%20do%20we%20need%20%26lt%3Bhgroup%26gt%3B%20when%20we%27ve%20already%20got%20the%20%26lt%3Bheader%26gt%3B%20element%3F%20In%20this%20article%2C%20we%27ll%20do%20our%20best%20to%20answer%20that%20question." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20hgroup%20element&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;t=The%20hgroup%20element" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element&amp;annotation=One%20of%20the%20new%20elements%20defined%20in%20HTML5%20is%20%26lt%3Bhgroup%26gt%3B%2C%20used%20for%20grouping%20titles%20with%20their%20associated%20subtitles.%20But%20why%20do%20we%20need%20%26lt%3Bhgroup%26gt%3B%20when%20we%27ve%20already%20got%20the%20%26lt%3Bheader%26gt%3B%20element%3F%20In%20this%20article%2C%20we%27ll%20do%20our%20best%20to%20answer%20that%20question." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20hgroup%20element&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;t=The%20hgroup%20element" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;title=The%20hgroup%20element&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=One%20of%20the%20new%20elements%20defined%20in%20HTML5%20is%20%26lt%3Bhgroup%26gt%3B%2C%20used%20for%20grouping%20titles%20with%20their%20associated%20subtitles.%20But%20why%20do%20we%20need%20%26lt%3Bhgroup%26gt%3B%20when%20we%27ve%20already%20got%20the%20%26lt%3Bheader%26gt%3B%20element%3F%20In%20this%20article%2C%20we%27ll%20do%20our%20best%20to%20answer%20that%20question." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;h=The%20hgroup%20element" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fthe-hgroup-element%2F&amp;t=The%20hgroup%20element&amp;s=One%20of%20the%20new%20elements%20defined%20in%20HTML5%20is%20%26lt%3Bhgroup%26gt%3B%2C%20used%20for%20grouping%20titles%20with%20their%20associated%20subtitles.%20But%20why%20do%20we%20need%20%26lt%3Bhgroup%26gt%3B%20when%20we%27ve%20already%20got%20the%20%26lt%3Bheader%26gt%3B%20element%3F%20In%20this%20article%2C%20we%27ll%20do%20our%20best%20to%20answer%20that%20question." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/the-hgroup-element/" rel="bookmark">The hgroup element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on March 23, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-hgroup-element/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>The small &amp; hr elements</title>
		<link>http://html5doctor.com/small-hr-element/</link>
		<comments>http://html5doctor.com/small-hr-element/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 13:58:55 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[hr]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[small]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1506</guid>
		<description><![CDATA[<p>Two more HTML4 presentational elements that have undergone transmogrification to have semantics in HTML5 are <code>&#60;small&#62;</code> and <code>&#60;hr&#62;</code></p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p><a href="http://html5doctor.com/i-b-em-strong-element/" title="The i, b, em, &amp; strong elements | HTML5 Doctor">We recently examined <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code></a>, presentational HTML4 elements that have been given a new lease on semantic life. Two more elements that have undergone transmogrification to receive semantics in HTML5 are <code>&lt;small&gt;</code> and <code>&lt;hr&gt;</code>:</p>

<ul>
<li><strong><code>&lt;small&gt;</code></strong> — was for smaller text, now used for <em>side comments and small print</em> (<a href="http://dev.w3.org/html5/markup/small.html" title="HTML5: small – small print (CHANGED)">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-small-element" title="4.6 Text-level semantics — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
<li><strong><code>&lt;hr&gt;</code></strong> — was horizontal rule, now used for <em>a paragraph-level thematic break</em> in text (<a href="http://dev.w3.org/html5/markup/hr.html" title="HTML5: hr – thematic break (CHANGED)">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/grouping-content.html#the-hr-element" title="4.5 Grouping content — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
</ul>

<section id="element-small">
<h2>The <code>&lt;small&gt;</code> element</h2>

<blockquote>
<p>The small element represents so-called “small print” such as legal disclaimers and caveats.</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/small.html" title="HTML5: small &#8211; small print (CHANGED)">W3C specification</a></cite></footer>
</blockquote>

<p><code>&lt;small&gt;</code> is now for <em>side comments</em>, which are the inline equivalent of <a href="http://html5doctor.com/understanding-aside/" title="Understanding aside | HTML5 Doctor"><code>&lt;aside&gt;</code></a> — content which is not the main focus of the page. A common example is inline legalese, such as a copyright statement in a page footer, a disclaimer, or licensing information. It can also be used for attribution. <strong>Don’t use it for block-level content</strong> (paragraphs, lists, etc.), as this would be considered main content.</p>

<figure>
<img src="http://html5doctor.com/wp-content/uploads/2010/03/small-license.png" alt="Using the small element for license information" title="Font license" width="524" height="36" class="alignnone size-full wp-image-1510" />
<figcaption>Using <code>&lt;small class="font-license"&gt;</code> to fulfill the requirements of a font license agreement</figcaption>
</figure>

<figure>
<blockquote><p><code>&lt;small&gt;&lt;a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution Share-alike license&lt;/a&gt;&lt;/small&gt;</code></p></blockquote>
<figcaption>Using <code>&lt;small&gt;</code> around a <a href="http://creativecommons.org/choose/" title="Choose a License">Creative Commons license</a> link with <code>rel="license"</code></figcaption>
</figure>

<p><code>&lt;small&gt;</code> text does not need to be smaller than surrounding text — if all you want is smaller text use CSS instead. Use <code>&lt;small&gt;</code> only on inline content. Finally, <code>&lt;small&gt;</code> doesn’t affect the semantics of <code>&lt;em&gt;</code> or <code>&lt;strong&gt;</code>.</p>
</section>

<section id="element-hr">
<h2>The <code>&lt;hr&gt;</code> element</h2>

<blockquote>
<p>The hr element represents a paragraph-level thematic break.</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/hr.html" title="HTML5: hr — thematic break (CHANGED)">W3C specification</a></cite></footer>
</blockquote>

<p><del datetime="2010-03-31T10:43:57+09:00">The “paragraph-level” bit means between <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/content-models.html#paragraph" title="3.2.5 Content models — HTML5 (including next generation additions still in development)">blocks of text</a>, so it can’t be used to separate sections of a site. Instead, <code>&lt;hr&gt;</code> now separates different topics within a section of prose, or between scenes in a novel.</del> <ins datetime="2010-03-31T11:00:02+09:00">After checking with Hixie I found I misinterpreted the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/content-models.html#paragraph" title="3.2.5 Content models — HTML5 (including next generation additions still in development)">paragraph content model</a> (we regret the error!). I learned <code>&lt;hr&gt;</code> actually means “<q cite="http://krijnhoetmer.nl/irc-logs/whatwg/20100331#l-169">end of one section, start of another</q>”, which is the same semantically as <code>&lt;/section&gt;&lt;section&gt;</code>. Because elements like <code>&lt;section&gt;</code> already indicate this intrinsically, <code>&lt;hr&gt;</code> is more for thematic breaks, such as separating different topics within a section of prose, or between scenes in a novel. However you can use it anywhere you can use a <code>&lt;p&gt;</code>.</ins> While not widely used these days (given the dull default browser renderings), it can be replaced via CSS with an image:</p>

<figure>
<a href="http://oli.jp/example/speckled-band/"><img src="http://html5doctor.com/wp-content/uploads/2010/03/hr-separator.png" alt="Horizontal rule (hr) separator, replaced using CSS with a background image" title="Horizontal rule separator" width="432" height="228" class="alignnone size-full wp-image-1511" /></a>
<figcaption>Style <code>&lt;hr&gt;</code> by removing borders and adding margins &amp; a background image using CSS. For example;<br />
<code>hr {height: 24px; background: url('flourish.png') no-repeat 50% 50%; margin: 3em 0; border: 0;}</code></figcaption>
</figure>

<p>IE7 and lower live up to reputation by adding a border around the image regardless, but <a href="http://blog.neatlysliced.com/2008/03/hr-image-replacement/" title="HR Image Replacement &rsaquo; Neatly Sliced">this can often be worked around</a>. Alternatively you can just hide it via an IE7-and-lower stylesheet. Use a CSS border or background image on another element instead if the transition is obvious (for example between weblog comments), or the intended use is solely presentational.</p>
<figure>
<a href="http://corkd.com/"><img src="http://html5doctor.com/wp-content/uploads/2010/03/corkd.png" alt="Cork’d title with decorative background image" title="A stylish title on Cork’d (thanks Lindsay!)" width="240" height="60" class="alignnone size-full wp-image-1512" /></a>
<figcaption><a href="http://corkd.com/" title="Cork'd | The new way to review, share and discuss wine.">Cork’d.com</a> uses a decorative CSS background image on titles. This would <strong>not</strong> be a good place to use <code>&lt;hr&gt;</code>.</figcaption>
</figure>
</section>

<section id="summary">
<h2>In summary</h2>
<p>When HTML4 was released, the presentational elements <code>&lt;basefont&gt;</code>, <code>&lt;font&gt;</code>, <code>&lt;s&gt;</code>, <code>&lt;strike&gt;</code>, and <code>&lt;u&gt;</code> were already deprecated in favour of CSS. HTML5 completes this by removing <code>&lt;big&gt;</code> and <code>&lt;tt&gt;</code>.</p>

<p>The remaining HTML4 presentational elements — the long-ignored <code>&lt;small&gt;</code> and <code>&lt;hr&gt;</code> elements (along with <a href="http://html5doctor.com/i-b-em-strong-element/" title="The i, b, em, &amp; strong elements | HTML5 Doctor"><code>&lt;i&gt;</code> and <code>&lt;b&gt;</code> from last week</a>) — have been redefined in HTML5 with useful, media-independent semantics that relate to their typical use. Will <em>you</em> be using them? Let us know in the comments!</p>
</section><div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://html5doctor.com/the-figure-figcaption-elements/" rel="bookmark" class="crp_title">The figure &#038; figcaption elements</a></li><li><a href="http://html5doctor.com/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/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</a></li><li><a href="http://html5doctor.com/ruby-rt-rp-element/" rel="bookmark" class="crp_title">The ruby element and her hawt friends, rt and rp</a></li><li><a href="http://html5doctor.com/the-section-element/" rel="bookmark" class="crp_title">The section element</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20small%20%26amp%3B%20hr%20elements%20-%20http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements&amp;bodytext=Two%20more%20HTML4%20presentational%20elements%20that%20have%20undergone%20transmogrification%20to%20have%20semantics%20in%20HTML5%20are%20%26lt%3Bsmall%26gt%3B%20and%20%26lt%3Bhr%26gt%3B" title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements&amp;notes=Two%20more%20HTML4%20presentational%20elements%20that%20have%20undergone%20transmogrification%20to%20have%20semantics%20in%20HTML5%20are%20%26lt%3Bsmall%26gt%3B%20and%20%26lt%3Bhr%26gt%3B" title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20small%20%26amp%3B%20hr%20elements&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;t=The%20small%20%26amp%3B%20hr%20elements" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements&amp;annotation=Two%20more%20HTML4%20presentational%20elements%20that%20have%20undergone%20transmogrification%20to%20have%20semantics%20in%20HTML5%20are%20%26lt%3Bsmall%26gt%3B%20and%20%26lt%3Bhr%26gt%3B" title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20small%20%26amp%3B%20hr%20elements&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;t=The%20small%20%26amp%3B%20hr%20elements" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;title=The%20small%20%26amp%3B%20hr%20elements&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=Two%20more%20HTML4%20presentational%20elements%20that%20have%20undergone%20transmogrification%20to%20have%20semantics%20in%20HTML5%20are%20%26lt%3Bsmall%26gt%3B%20and%20%26lt%3Bhr%26gt%3B" title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;h=The%20small%20%26amp%3B%20hr%20elements" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fsmall-hr-element%2F&amp;t=The%20small%20%26amp%3B%20hr%20elements&amp;s=Two%20more%20HTML4%20presentational%20elements%20that%20have%20undergone%20transmogrification%20to%20have%20semantics%20in%20HTML5%20are%20%26lt%3Bsmall%26gt%3B%20and%20%26lt%3Bhr%26gt%3B" title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/small-hr-element/" rel="bookmark">The small &amp; hr elements</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on March 16, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/small-hr-element/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>The i, b, em, &amp; strong elements</title>
		<link>http://html5doctor.com/i-b-em-strong-element/</link>
		<comments>http://html5doctor.com/i-b-em-strong-element/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 15:40:01 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[Elements]]></category>
		<category><![CDATA[b]]></category>
		<category><![CDATA[em]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[i]]></category>
		<category><![CDATA[strong]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=1443</guid>
		<description><![CDATA[<p>While many HTML4 elements have been brought into HTML5 essentially unchanged, several historically presentational ones have been given semantic meanings. Let’s look at <code>&#60;i&#62;</code> and <code>&#60;b&#62;</code> and compare them to the semantic stalwarts <code>&#60;em&#62;</code> and <code>&#60;strong&#62;</code>.</p>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;source=html5doctor&amp;style=normal&amp;service=is.gd" height="61" width="50" />
			</a>
		</div><p>While many HTML4 elements have been brought into HTML5 essentially unchanged, several historically presentational ones have been given semantic meanings.</p>

<span id="more-1443"></span>

<p>Let’s look at <code>&lt;i&gt;</code> and <code>&lt;b&gt;</code> and compare them to the semantic stalwarts <code>&lt;em&gt;</code> and <code>&lt;strong&gt;</code>. In summary:</p>

<ul class="toc-list">
<li><strong><code>&lt;i&gt;</code></strong> — was italic, now for <em>text in an “alternate voice,”</em> such as foreign words, technical terms and typographically italicized text (<a href="http://dev.w3.org/html5/markup/i.html" title="HTML5: i &#8211; offset text typically styled in italic">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-i-element" title="4.6 Text-level semantics — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
<li><strong><code>&lt;b&gt;</code></strong> — was bold, now for <em>“stylistically offset” text</em>, such as keywords and typographically emboldened text (<a href="http://dev.w3.org/html5/markup/b.html" title="HTML5: b &#8211; offset text typically styled in bold (CHANGED)">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-b-element" title="4.6 Text-level semantics — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
<li><strong><code>&lt;em&gt;</code></strong> — was emphasis, now for <em>stress emphasis</em>, i.e., something you’d pronounce differently (<a href="http://dev.w3.org/html5/markup/em.html" title="HTML5: em &#8211; emphatic stress (CHANGED)">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-em-element" title="4.6 Text-level semantics — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
<li><strong><code>&lt;strong&gt;</code></strong> — was for stronger emphasis, now for <em>strong importance</em>, basically the same thing (stronger emphasis or importance is now indicated by nesting) (<a href="http://dev.w3.org/html5/markup/strong.html" title="HTML5: strong &#8211; strong importance (CHANGED)">W3C:Markup</a>, <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-strong-element" title="4.6 Text-level semantics — HTML5 (including next generation additions still in development)">WHATWG</a>)</li>
</ul>

<section>
<h2>Giving presentational elements new semantic meanings</h2>

<p><code>&lt;i&gt;</code> and <code>&lt;b&gt;</code> were <a href="http://www.w3.org/TR/html401/present/graphics.html#h-15.2.1" title="Alignment, font styles, and horizontal rules in HTML documents">HTML4 font style elements</a> and are still used presentationally where appropriate to follow typographic conventions. They now have semantic meaning, however, and their style can be changed via CSS, meaning they’re not <em>only</em> presentational — <code>&lt;b&gt;</code>, for example, doesn’t have to be bold. Because of this, <strong>it’s recommended to use classes to indicate meaning</strong> to make it easy to change the style later.</p>

<section id="element-i">
<h3>The <code>&lt;i&gt;</code> element</h3>

<blockquote>
<p>The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose (content whose typical typographic presentation is italicized).</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/i.html" title="HTML5: i &#8211; offset text typically styled in italic">W3C specification</a></cite></footer>
</blockquote>

<p>Things that are typically italicised include foreign words (using the attribute <code>lang=""</code>), taxonomic and technical terms, ship names, inline stage directions in a script, some musical notation, and when representing thoughts or hand-written text inline:</p>

<figure id="deckard"><blockquote cite="http://www.trussel.com/bladerun.htm">
<ol class="script semantic-list">
<li><b class="character">Deckard</b>: Move! Get out of the way!</li>
<li class="action">Deckard fires. Kills Zhora in dramatic slow motion scene.</li>
<li><b class="character">Deckard</b>: <i class="voiceover">The report would be routine retirement of a replicant which didn&#8217;t make me feel any better about shooting a woman in the back. There it was again. Feeling, in myself. For her, for Rachael.</i></li>
<li><b class="character">Deckard</b>: Deckard. B-263-54.</li>
</ol></blockquote>
<figcaption>Using <code>&lt;i class="voiceover"&gt;</code> to indicate a voiceover (alternate mood)</figcaption></figure>

<figure id="japanese">
<blockquote>
<p>We ate <i lang="ja-latn" title="eel">unagi</i>, <i lang="ja-latn" title="seared salmon">aburi-zake</i>, and <i lang="ja-latn" title="octopus">tako</i> sushi last night, but the <i lang="ja-latn" title="fatty bluefin tuna belly—LET’S EAT IT ALL!">toro</i> sushi was all fished out.</p>
</blockquote>
<figcaption>Using <code>&lt;i lang="ja-latn"&gt;</code> to indicate “an idiomatic phrase from another language” (or, Japanese). To check character sets for <code>lang=""</code> values you can use the <a href="http://www.iana.org/assignments/character-sets" title="IANA, monospace-ing like it’s 1989">IANA’s official list of character sets</a> (ouch), or the excellent <a href="http://rishida.net/utils/subtags/" title="ishida &gt;&gt; utilities: Language subtag registry search">Language Subtag Lookup tool by Richard Ishida, W3C</a>.</figcaption>
</figure>

<figure id="nanotyrannus">
<blockquote cite="http://en.wikipedia.org/wiki/Nanotyrannus">
<p><i class="taxonomy">Nanotyrannus</i> (&#8220;dwarf tyrant&#8221;) is a genus of tyrannosaurid dinosaur, and is possibly a juvenile specimen of <i class="taxonomy">Tyrannosaurus</i>. It is based on CMN 7541, a skull collected in 1942 and described by Charles W. Gilmore described in 1946, who gave it the new species <i class="taxonomy">Gorgosaurus lancensis</i>.</p>
</blockquote>
<figcaption>Using <code>&lt;i class="taxonomy"&gt;</code> for taxonomic names</figcaption>
</figure>

<p>Only use <code>&lt;i&gt;</code> when nothing more suitable is available — e.g., <code>&lt;em&gt;</code> for text with stress emphasis, <code>&lt;strong&gt;</code> for text with semantic importance, <code>&lt;cite&gt;</code> for titles in a citation or bibliography, <code>&lt;dfn&gt;</code> for defining a word, and <code>&lt;var&gt;</code> for mathematical variables. Use CSS instead for italicizing blocks of text, such as asides, verse, and (as used here for W3C specification quote) block quotations. Remember to use the <code>class</code> attribute to identify why the element is being used, making it easy to restyle a particular use. You can target <code>lang</code> in CSS using the attribute selector (eg <code>[lang="ja-latn"]</code>).</p>
</section>

<section id="element-b">
<h3>The <code>&lt;b&gt;</code> element</h3>

<blockquote>
<p>The <code>&lt;b&gt;</code> element represents a span of text offset from its surrounding content without conveying any extra importance; for example, keywords in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is bold text.</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/b.html" title="HTML5: b &#8211; offset text typically styled in bold (CHANGED)">W3C specification</a></cite></footer>
</blockquote>

<p>For <code>&lt;b&gt;</code> text that should merely look different, there is no requirement to use <code>font-style: bold;</code> — other styling could include a round-cornered background, larger font size, different color, or formatting such as small caps. For instance, <a href="#deckard">in the script example above</a>, <code>&lt;b class="character"&gt;</code> is used to indicate who’s speaking or narrating.</p>

<p>Text that is bold by typographic convention (and <strong>not</strong> because it’s more important) could include names in a Hollywood gossip column or the initial text on a complex or traditionally designed page:</p>

<figure>
<a href="http://oli.jp/example/speckled-band/"><img src="http://html5doctor.com/wp-content/uploads/2010/02/opening-phrase.png" alt="Opening versal (drop cap), plus styling of first phrase using b" title="Opening phrase" width="528" height="84" class="alignnone size-full wp-image-1464" /></a>
<figcaption>Connecting the versal (drop cap) with the text using <code>&lt;b class="opening-phrase"&gt;</code>. The pseudo-element selector <code>:first-letter</code> is used to create the versal. In this case, the opening phrase is bold only for stylistic reasons, but if it was semantically important, <code>&lt;strong&gt;</code> or some other element would be more appropriate. <del datetime="2010-03-10T23:51:21+09:00">Note that <code>:first-letter</code> only applies to block-level elements, so the versal “I” is not inside <code>&lt;b&gt;</code>.</del></figcaption>
</figure>

<figure>
<a href="http://oli.jp/example/speckled-band/"><img src="http://html5doctor.com/wp-content/uploads/2010/02/opening-line.png" alt="Using :first-line instead of the b element" title="Opening line" width="528" height="156" class="alignnone size-full wp-image-1463" /></a>
<figcaption>While we can use <code>&lt;b&gt;</code> to apply a traditional typographic style like small-caps to the first word, phrase or sentence, the CSS pseudo-element selector <code>:first-line</code> is more appropriate in this case. For the first paragraph of <a href="http://html5doctor.com/" title="HTML5 Doctor, helping you implement HTML5 today">HTML5Doctor.com</a> articles we use the nifty <code>:first-of-type</code> CSS3 pseudo-class selector.</figcaption>
</figure>

<p>Only use <code>&lt;b&gt;</code> when there are no other more suitable elements — e.g., <code>&lt;strong&gt;</code> for text with semantic importance, <code>&lt;em&gt;</code> for emphasized text (text with “stress emphasis”), <code>&lt;h1&gt;</code>–<code>&lt;h6&gt;</code> for titles, and <code>&lt;mark&gt;</code> for highlighted or marked text. Use classes on list items for a <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#tag-clouds" title="4.12 Links — HTML5 (including next generation additions still in development)">tag cloud</a>. To recreate traditional typographic effects, use <a href="http://www.w3.org/TR/CSS2/selector.html#pseudo-element-selectors" title="Selectors">CSS pseudo-element selectors</a> like <code>:first-line</code> and <code>:first-letter</code> where appropriate. Again, remember to use the <code>class</code> attribute to identify why the element is being used, making it easy to restyle a particular use.</p>

</section>
</section>

<section>
<h2>…and for comparison, the <code>&lt;em&gt;</code> and <code>&lt;strong&gt;</code> elements</h2>

<p class="callout highlight-block">While <code>&lt;em&gt;</code> and <code>&lt;strong&gt;</code> have remained pretty much the same, there has been a slight realignment in their meanings. In HTML4 they meant ‘emphasis’ and ‘strong emphasis’. Now their meanings have been differentiated into <code>&lt;em&gt;</code> representing <em>stress emphasis</em> (i.e., something you’d pronounce differently), and <code>&lt;strong&gt;</code> representing <em>importance</em>.</p>

<section>
<h3 id="element-em">The <code>&lt;em&gt;</code> element</h3>
<blockquote>
<p>The em element represents a span of text with emphatic stress.</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/em.html" title="HTML5: em &#8211; emphatic stress (CHANGED)">W3C specification</a></cite></footer>
</blockquote>

<p>The ‘stress’ being referred to is linguistic. If spoken, this stress would be emphasised pronunciation on a word that can change the nuance of a sentence. For example, “Call a <em>doctor</em> now!” emphasises the importance of calling a doctor, perhaps in reply to someone asking “Should I get a nurse?” In contrast, “Call a doctor <em>now</em>!” emphasises the importance of calling immediately.</p>

<p>Use <code>&lt;strong&gt;</code> instead to indicate importance and <code>&lt;i&gt;</code> when you want italics without implying emphasis. The level of nesting represents the level of emphasis.</p>
</section>

<section id="element-strong">
<h3>The <code>&lt;strong&gt;</code> element</h3>
<blockquote>
<p>The strong element represents a span of text with strong importance.</p>
<footer><cite><a href="http://dev.w3.org/html5/markup/strong.html" title="HTML5: strong &#8211; strong importance (CHANGED)">W3C specification</a></cite></footer>
</blockquote>

<p>Not much more to say really — it’s the <code>&lt;strong&gt;</code> we all know so well. Indicate relative importance by nesting <code>&lt;strong&gt;</code> elements, and use <code>&lt;em&gt;</code> for text with stress emphasis, or <code>&lt;b&gt;</code> for text that is “stylistically offset” or bold without being more important.</p>
</section>
</section>

<section>
<h2>In summation…</h2>
<p>A final thing to note: these elements (and almost all HTML5 elements) have also been made explicitly <em>media-independent</em>, meaning their semantics are not tied to how they look in a visual browser.</p>

<p>So there you have it — two stray dogs of presentational HTML4 have been transformed into meaningful HTML5 elements, ready to be adopted into your coding once again. Can <em>you</em> resist their semantically shiny puppy-dog eyes? Let us know!</p>

</section><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/ruby-rt-rp-element/" rel="bookmark" class="crp_title">The ruby element and her hawt friends, rt and rp</a></li><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/html-5-reset-stylesheet/" rel="bookmark" class="crp_title">HTML5 Reset Stylesheet</a></li><li><a href="http://html5doctor.com/measure-up-with-the-meter-tag/" rel="bookmark" class="crp_title">Measure up with the meter tag</a></li></ul></div>


Share and Save:


	<a rel="nofollow"  href="http://twitter.com/home?status=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements%20-%20http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F" title="Twitter"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;bodytext=While%20many%20HTML4%20elements%20have%20been%20brought%20into%20HTML5%20essentially%20unchanged%2C%20several%20historically%20presentational%20ones%20have%20been%20given%20semantic%20meanings.%20Let%E2%80%99s%20look%20at%20%26lt%3Bi%26gt%3B%20and%20%26lt%3Bb%26gt%3B%20and%20compare%20them%20to%20the%20semantic%20stalwarts%20%26lt%3Bem%26gt%3B%20and%20%26lt%3Bstrong%26gt%3B." title="Digg"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F" title="Sphinn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements" title="Reddit"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;notes=While%20many%20HTML4%20elements%20have%20been%20brought%20into%20HTML5%20essentially%20unchanged%2C%20several%20historically%20presentational%20ones%20have%20been%20given%20semantic%20meanings.%20Let%E2%80%99s%20look%20at%20%26lt%3Bi%26gt%3B%20and%20%26lt%3Bb%26gt%3B%20and%20compare%20them%20to%20the%20semantic%20stalwarts%20%26lt%3Bem%26gt%3B%20and%20%26lt%3Bstrong%26gt%3B." title="del.icio.us"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements" title="StumbleUpon"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F" title="Technorati"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.netvibes.com/share?title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F" title="Netvibes"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;t=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements" title="Facebook"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;annotation=While%20many%20HTML4%20elements%20have%20been%20brought%20into%20HTML5%20essentially%20unchanged%2C%20several%20historically%20presentational%20ones%20have%20been%20given%20semantic%20meanings.%20Let%E2%80%99s%20look%20at%20%26lt%3Bi%26gt%3B%20and%20%26lt%3Bb%26gt%3B%20and%20compare%20them%20to%20the%20semantic%20stalwarts%20%26lt%3Bem%26gt%3B%20and%20%26lt%3Bstrong%26gt%3B." title="Google Bookmarks"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.friendfeed.com/share?title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;link=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F" title="FriendFeed"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/friendfeed.png" title="FriendFeed" alt="FriendFeed" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;t=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements" title="HackerNews"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;title=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;source=HTML5+Doctor+helping+you+implement+HTML5+today&amp;summary=While%20many%20HTML4%20elements%20have%20been%20brought%20into%20HTML5%20essentially%20unchanged%2C%20several%20historically%20presentational%20ones%20have%20been%20given%20semantic%20meanings.%20Let%E2%80%99s%20look%20at%20%26lt%3Bi%26gt%3B%20and%20%26lt%3Bb%26gt%3B%20and%20compare%20them%20to%20the%20semantic%20stalwarts%20%26lt%3Bem%26gt%3B%20and%20%26lt%3Bstrong%26gt%3B." title="LinkedIn"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;h=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements" title="NewsVine"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fhtml5doctor.com%2Fi-b-em-strong-element%2F&amp;t=The%20i%2C%20b%2C%20em%2C%20%26amp%3B%20strong%20elements&amp;s=While%20many%20HTML4%20elements%20have%20been%20brought%20into%20HTML5%20essentially%20unchanged%2C%20several%20historically%20presentational%20ones%20have%20been%20given%20semantic%20meanings.%20Let%E2%80%99s%20look%20at%20%26lt%3Bi%26gt%3B%20and%20%26lt%3Bb%26gt%3B%20and%20compare%20them%20to%20the%20semantic%20stalwarts%20%26lt%3Bem%26gt%3B%20and%20%26lt%3Bstrong%26gt%3B." title="Tumblr"><img src="http://html5doctor.com/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/><p><a href="http://html5doctor.com/i-b-em-strong-element/" rel="bookmark">The i, b, em, &amp; strong elements</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on March 9, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/i-b-em-strong-element/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>
