<?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; CSS</title>
	<atom:link href="http://html5doctor.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://html5doctor.com</link>
	<description>helping you implement HTML5 today</description>
	<lastBuildDate>Wed, 01 Feb 2012 09:28:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>The return of the u element</title>
		<link>http://html5doctor.com/u-element/</link>
		<comments>http://html5doctor.com/u-element/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 14:00:37 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Specification Changes]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[u]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3862</guid>
		<description><![CDATA[<p>The <code>&#60;u&#62;</code> element was deprecated in HTML 4 and non-conforming in HTML5, but a couple of use cases have seen it return from the dead. Are the use cases enough to persuade you that it’s a phoenix not a zombie?</p>]]></description>
			<content:encoded><![CDATA[<p>Presentational elements like <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>, <code>&lt;b&gt;</code></a>, <a href="http://html5doctor.com/small-hr-element/" title="The small &amp; hr elements | HTML5 Doctor"><code>&lt;small&gt;</code> and <code>&lt;hr&gt;</code></a> have been redefined in HTML5 with semantic meanings, or, in a couple of cases, made non-conforming. The <code>&lt;u&gt;</code> element had been in the non-conforming camp, but a couple of semantic use cases led it back into the fold. While most of us will never need it (and some will jeer), on the odd occasion, it might be just the element you need.</p>

<p>Before HTML5, <code>&lt;u&gt;</code> was solely for applying a presentational style of <em>underlining</em> to text. <a href="http://www.w3.org/TR/html401/present/graphics.html#h-15.2" title="Alignment, font styles, and horizontal rules in HTML documents">HTML 4 discouraged “font-style” or presentational elements</a>, and even <a href="http://www.w3.org/TR/html401/appendix/changes.html#idx-deprecated" title="HTML 4 Changes">deprecated <code>&lt;u&gt;</code></a>, advising us to use CSS instead. Even before this, <code>&lt;u&gt;</code> was frowned upon as underlines are the browser default for links, and making normal text look like links gives users a bad case of clicky-clicky frustration. <code>&lt;u&gt;</code> was initially non-conforming in HTML5.</p>

<p>There are, however, a couple of non-link places where text <em>is</em> traditionally underlined to convey meaning, as the HTML5 specification’s definition mentions:</p>

<blockquote>
<p>The <code>u</code> element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.</p>
<footer>— <cite><a href="http://www.whatwg.org/specs/web-apps/current-work/complete/text-level-semantics.html#the-u-element" title="4.6 Text-level semantics &#8212; Web Applications 1.0"><abbr title="">WHATWG</abbr> HTML5 specification</a></cite></footer>
</blockquote>

<p>Before we get to them, let’s quickly cover <em>an unarticulated, though explicitly rendered, non-textual annotation</em>. This means <q><code>&lt;u&gt;</code> is for when you are annotating something, but not explicitly saying what it is</q> (<cite><a href="http://krijnhoetmer.nl/irc-logs/whatwg/20110930#l-916" title="IRC logs: freenode / #whatwg / 20110930">WHATWG IRC</a></cite>, Ian Hickson) — the annotation’s meaning is implied by context.</p>

<section id="proper-name-mark">
<h2>Chinese proper name marks <a class="permalink" href="#proper-name-mark">#</a></h2>

<p>And what exactly are those you ask? I had to ask Wikipedia myself:</p>

<blockquote>
<p>In Chinese writing, a proper name mark (Simplified Chinese: <span lang="Hans">专名号</span>, <span lang="zh-Latn">zhuānmínghào</span>; Traditional Chinese: <span lang="Hant">專名號</span>) is an underline used to mark proper names, such as the names of people, places, dynasties, organizations. … This method of recognizing proper names in text is similar to the English use of a capital letter.</p>
<footer>— <cite><a href="http://en.wikipedia.org/wiki/Proper_name_mark" title="Proper name mark - Wikipedia, the free encyclopedia">Proper name mark</a></cite>, Wikipedia</footer>
</blockquote>

<p>Wikipedia gives the following example, which I’ve formatted using <code>&lt;u&gt;</code>:</p>

<figure id="pnm">
<style scoped>#pnm .pnm, #pnm .bnm {text-decoration: underline;}
#pnm .bnm {
  -moz-text-decoration-style: wavy;
  text-decoration-style: wavy;
}
#pnm p[lang="zh"] cite {font-style: normal;}</style>
<pre><code lang="zh">&lt;u class="pnm"&gt;屈原&lt;/u&gt;放逐，乃賦&lt;cite class="bnm"&gt;離騒&lt;/cite&gt;。&lt;u class="pnm"&gt;左丘&lt;/u&gt;失明，厥有&lt;cite class="bnm"&gt;國語&lt;/cite&gt;。（司馬遷 《&lt;cite&gt;報任安書&lt;/cite&gt;》）</code></pre>
<p lang="zh"><u class="pnm">屈原</u>放逐，乃賦<cite class="bnm">離騒</cite>。<u class="pnm">左丘</u>失明，厥有<cite class="bnm">國語</cite>。（司馬遷 《<cite>報任安書</cite>》）</p>
<!-- The source doesn’t use proper and book name marks for the citation because modern usage is only to use guillemets for the title — only the quoted text is classical -->
<p><mark lang="zh">Qu Yuan</mark> was exiled, and thus composed the <mark lang="zh"><cite>Li Sao</cite></mark>. <mark lang="zh">Zuo Qiu</mark> lost his sight, hence there is the <mark lang="zh"><cite>Guo Yu</cite></mark>. (<span lang="zh">Sima Qian</span>, “<cite>Letter to <span lang="zh">Ren'an</span></cite>”)</p>
<figcaption>Using <code>&lt;u&gt;</code> for Chinese proper name marks where appropriate</figcaption>
</figure>

<p>If you’re using Firefox 6+ you’ll also see the appropriate wavy underline for a Chinese book name mark on the quote’s source, courtesy of CSS3’s <code>text-decoration-style: wavy;</code>. I’ve used <code>&lt;cite&gt;</code> for book name marks as it’s more appropriate than <code>&lt;u&gt;</code>. You can find out more about <code>wavy</code> in <a href="http://dev.w3.org/csswg/css3-text/Overview.html#decoration" title="CSS Text Level 3">CSS Text Level 3</a>.</p>

<!-- /#proper-name-mark --></section>

<section id="spell-check">
<h2>Using <code>&lt;u&gt;</code> for spell-checking feedback <a class="permalink" href="#spell-check">#</a></h2>

<p>While you’re probably not marking up classical Chinese prose, a more familiar use case is for a spell-checker to indicate incorrect text. The default formatting in word processors is typically a red underline for spelling errors, and a green underline for grammatical errors:</p>

<figure id="spelling">
<style scoped>#spelling .spelling-error {
  text-decoration: none;
  border-bottom: 1px dashed red;
}
#spelling .grammatical-error {
  text-decoration: none;
  border-bottom: 1px dashed green;
}</style>
<pre><code>.spelling-error {
  text-decoration: none;
  border-bottom: 1px dashed red;
}
.grammatical-error {
  text-decoration: none;
  border-bottom: 1px dashed green;
}
&lt;p&gt;hello doctor i am having a huge body &lt;u class="spelling-error"&gt;oder&lt;/u&gt; &lt;u class="grammatical-error"&gt;it is smell really bad&lt;/u&gt;&lt;/p&gt;</code></pre>
<p>hello doctor i am having a huge body <u class="spelling-error">oder</u> <u class="grammatical-error">it is smell really bad</u></p>
<figcaption>Using <code>&lt;u&gt;</code> for annotating spell checker feedback</figcaption>
</figure>

<p>While we’ve turned off the default <code>text-decoration</code> style, <code>&lt;u&gt;</code> will back us up if CSS is disabled, and potentially provide more information for assistive technology. After all, if it’s semantic it should be in HTML, not CSS.</p>

<p>Some word processors use wavy underlines. This CSS would have the same effect in a supporting browser:</p>

<pre><code>.spelling-error {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: red;
}
.grammatical-error {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: green;
}</code></pre>

<p>Or, using <code>text-decoration</code> as a shorthand property, and adding a default declaration for non-supporting browsers:</p>

<pre><code>.spelling-error {
  text-decoration: underline; /* for backwards compatibility */
  text-decoration: underline wavy red;
}
.grammatical-error {
  text-decoration: underline; /* for backwards compatibility */
  text-decoration: underline wavy green;
}</code></pre>

<p>Again, you can read more about the upgraded <code>text-decoration</code> properties in <a href="http://dev.w3.org/csswg/css3-text/Overview.html#decoration" title="CSS Text Level 3">CSS Text Level 3</a>.</p>

<!-- /#spell-check --></section>

<section id="family-names">
<h2>Using <code>&lt;u&gt;</code> for indicating family names <a class="permalink" href="#family-names">#</a></h2>

<p>Another use for <code>&lt;u&gt;</code> is to annotate a family name when this might be confusing — Chinese, Japanese, Korean and Vietnamese (among others) all traditionally write names in a different order than the western-centric “given-name family-name”. While applying a blanket western ordering is fairly common (especially when publishing in English), it’s good form to use culturally appropriate ordering. If the audience might misunderstand, the family name can be underlined, capitalised, or otherwise annotated to make the name order explicit. For example, the <abbr title="Central Intelligence Agency">CIA</abbr>’s World Fact Book capitalises the family name:</p>

<blockquote>
<p>After World War II, the Communists under <mark>MAO Zedong</mark> established an autocratic socialist system …</p>
<footer>— <cite><a href="https://www.cia.gov/library/publications/the-world-factbook/geos/ch.html">The World Factbook</a></cite>, <abbr title="Central Intelligence Agency">CIA</abbr></footer>
</blockquote>

<p>This ties in nicely with <a href="http://html5doctor.com/microformats/#hcard" title="Extending HTML5 — Microformats | HTML5 Doctor">the hCard microformat</a>, as the “implied <code>n</code> optimisation” doesn’t work with these non-western ordered names, and we need a wrapper element to indicate each part of the name anyhow.</p>

<figure id="family-name1">
<style scoped>#family-name1 .family-name {text-decoration: underline;}</style>
<pre><code>&lt;style&gt;
  .family-name {text-decoration: underline;}
&lt;/style&gt;
&lt;p&gt;
  &lt;span class="vcard" lang="ja-latn"&gt;
    &lt;span class="fn n"&gt;
      &lt;u class="family-name"&gt;Son&lt;/u&gt; &lt;span class="given-name"&gt;Goku&lt;/span&gt;
    &lt;/span&gt;
  &lt;/span&gt;
   is the main protagonist in 
  &lt;span class="vcard" lang="ja-latn"&gt;
    &lt;span class="fn n"&gt;
      &lt;span class="given-name"&gt;Akira&lt;/span&gt; &lt;u class="family-name"&gt;Toriyama&lt;/u&gt;
    &lt;/span&gt;
  &lt;/span&gt;’s &lt;i lang="ja-latn"&gt;manga&lt;/i&gt; “Dragon Ball”.
&lt;/p&gt;</code></pre>
<p><span class="vcard" lang="ja-latn"><span class="fn n"><u class="family-name">Son</u> <span class="given-name">Goku</span></span></span> is the main protagonist in <span class="vcard" lang="ja-latn"><span class="fn n"><span class="given-name">Akira</span> <u class="family-name">Toriyama</u></span></span>’s <i lang="ja-latn">manga</i> “Dragon Ball”.</p>
<figcaption>Using <code>&lt;u&gt;</code> to indicate the family name in non-western names via underlining</figcaption>
</figure>

<p>Of course you can then change the style via CSS, for example</p>

<figure id="family-name2">
<style scoped>#family-name2 .family-name {
  text-decoration: none;
  text-transform: uppercase;
}</style>
<pre><code>.family-name {
  text-decoration: none;
  text-transform: uppercase;
}
</code></pre>
<p><span class="vcard" lang="ja-latn"><span class="fn n"><u class="family-name">Son</u> <span class="given-name">Goku</span></span></span> is the main protagonist in <span class="vcard" lang="ja-latn"><span class="fn n"><span class="given-name">Akira</span> <u class="family-name">Toriyama</u></span></span>’s <i lang="ja-latn">manga</i> “Dragon Ball”.</p>
<figcaption>Using <code>&lt;u&gt;</code> to indicate the family name in non-western names via capitalisation</figcaption>
</figure>

<p>The benefit of using <code>&lt;u&gt;</code> for this is the family name will be indicated even when CSS is disabled, ensuring the annotation isn’t lost. Assistive technology may also be able to inform the user of this in the future.</p>

<!-- /#family-names --></section>

<section id="do-we-need-u">
<h2>But do we need <code>&lt;u&gt;</code>? <a class="permalink" href="#do-we-need-u">#</a></h2>

<p>A lot of people bitten by the web standardista bug have somewhat of an allergic reaction to ex-presentational elements in HTML5, after influential articles like Tantek Çelik’s “<a href="http://tantek.com/log/2002/10.html#L20021022t1432" title="tantek/log/2002/10"><code>&lt;b&gt;</code>ed and <code>&lt;br&gt;</code>eakfast markup</a>”. Given <code>&lt;u&gt;</code>’s ignoble past, I expect the reaction to its return will also lead to some poo-pooing. As we already mentioned, however, <em>if it imparts meaning, it should be in HTML</em>. These use cases involve semantic meaning, and even without assistive technology support, <code>&lt;u&gt;</code> conveys some meaning to sighted users via the browser-default style <code>text-decoration: underline;</code>.</p>

<p>Regardless of whether an element is deprecated (HTML 4, XHTML 1)  or non-conforming (HTML5) or just plain uncool, browser makers still have to support it for backward compatibility with all those awesome web pages from the days when <code>&lt;blink&gt;</code> was hawt. Because of this, if there’s a semantic use case for an ex-presentational element, it’s definitely better to reform it rather than minting a new element with no backward compatibility. You might think <code>&lt;mark&gt;</code> sounds pretty similar, but the default browser styling would be completely wrong for proper name marks, and <a href="http://krijnhoetmer.nl/irc-logs/whatwg/20110930#l-890" title="IRC logs: freenode / #whatwg / 20110930">semantically less appropriate for spelling errors</a> too.</p>

<p>As Ian Hickson explains:</p>

<blockquote>
<p>The presentational markup that was <code>&lt;u&gt;</code>, <code>&lt;i&gt;</code>, <code>&lt;b&gt;</code>, <code>&lt;font&gt;</code>, <code>&lt;small&gt;</code>, etc, is gone. However, there are certain use cases that did not yet have elements yet were important enough to warrant us supporting them. By reusing existing elements, we are able to support them without having to wait for new elements to be implemented. By doing so in a way that closely matches how those elements were actually used in practice (at least to the same extent as other elements have been correctly used in practice) we can not only have older UAs support these new elements automatically, but we can do so in a way that does not introduce an undue volume of invalid pages.</p>
<footer>— <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-July/032715.html" title="[whatwg] sic element">WHATWG email list</a>, Ian Hickson</footer>
</blockquote>

<!-- /#do-we-need-u --></section>

<section id="conclusion">
<h2>Conclusion</h2>

<p>Given the potential to confuse underlined text with links, using <code>text-decoration: underline;</code> on anything other than <code>&lt;a&gt;</code> is bad pretty much all the time. <strong>Generally <code>&lt;u&gt;</code> is not the element you’re looking for</strong>, even for Chinese book name marks (<code>&lt;cite&gt;</code> would be more appropriate). <em>However</em>, for at least these three use cases, it’s good to have a semantic option, something better than <code>&lt;span&gt;</code>.</p>

<p>So…in a hypothetical world where you did need to code for one of these situations, would you use <code>&lt;u&gt;</code> or something else like <code>&lt;span&gt;</code>? Let us know in the comments!</p>

<!-- /#conclusion --></section>
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><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/blockquote-q-cite/" rel="bookmark" class="crp_title">Quoting and citing with <code>&lt;blockquote&gt;</code>, <code>&lt;q&gt;</code>, <code>&lt;cite&gt;</code>, and the cite attribute</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/the-address-element/" rel="bookmark" class="crp_title">The Address Element</a></li></ul></div><p><a href="http://html5doctor.com/u-element/" rel="bookmark">The return of the u element</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on October 25, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/u-element/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>The scoped attribute</title>
		<link>http://html5doctor.com/the-scoped-attribute/</link>
		<comments>http://html5doctor.com/the-scoped-attribute/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 13:30:57 +0000</pubDate>
		<dc:creator>Jack Osborne</dc:creator>
				<category><![CDATA[Attributes]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3634</guid>
		<description><![CDATA[<p>The scoped attribute for the style element allows you to include styles mid-document that targets a specific element and its children. Depending upon how you look at this, it’ll either be a godsend or a curse. Once you’ve reached the end of this article, I hope you can form your own opinion.</p>]]></description>
			<content:encoded><![CDATA[<p>The <code>scoped</code> attribute for the <code>&lt;style&gt;</code> element allows you to include styles mid-document that targets a specific element and its children. Depending upon how you look at this, it’ll either be a godsend or a curse. Once you’ve reached the end of this article, I hope you can form your own opinion.</p>

<p>Let’s take a quick look at the spec:</p>

<blockquote>
<p>The <code>scoped</code> attribute is a boolean attribute. If set, it indicates that the styles are intended just for the subtree rooted at the style element’s parent element, as opposed to the whole Document.</p>
<footer>— <cite><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#attr-style-scoped" title="Scoped attribute — HTML5">WHATWG</a></cite></footer>
</blockquote>

<section id="bad">
<h2>Isn’t this bad practice?</h2>
<p>For years, we’ve been told (and have actively told others) to separate content and presentation layers. So why would we introduce something that seems to go against everything we’ve been preaching?</p>

<p>The separation of these layers is still vitally important, but let’s look at a few use cases to shed some light on why this attribute has been introduced. Scoped style provides a W3C-approved way to:</p> 

<ul>
  <li>Add one-off CSS styles.</li>
  <li>Add user-defined styles to wiki or CMS content.</li>
  <li>Add theme-defined styles via CMS plugins.</li>
  <li>Keep syndicated content together (e.g., keeping example code together with the example).</li>
</ul>
</section>

<section id="how-does">
<h2>How does it work?</h2>
<p>In this section, I’ll show you how this new attribute will work when it gets rolled out to browsers.</p>

<section id="starting">
<h3>Our starting point</h3>

<p>We’ll be using the following code sample as a starting point:</p>

<pre><code>&#60;article&#62;
  &#60;h1&#62;Style Scoped&#60;/h1&#62;
  &#60;p&#62;The scoped attribute for the style element will eventually allow for you to include style elements mid-document. To do this, you must mark up your style element with the scoped attribute.&#60;/p&#62;
  &#60;section&#62;
    &#60;h2&#62;How does it work?&#60;/h2&#62;
    &#60;p&#62;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.&#60;/p&#62;
  &#60;/section&#62;
&#60;/article&#62;</code></pre>

<p>This is a basic example, with two headings and two paragraphs set within the article element.</p>
</section>

<section id="addingscope">
<h3>Adding the <code>scoped</code> attribute</h3>

<p>In the next example, we’ll change the foreground color of the second paragraph to red (from whatever was defined in the master CSS file):</p>

<pre><code>&#60;article&#62;
  &#60;h1&#62;Style Scoped&#60;/h1&#62;
  &#60;p&#62;The scoped attribute for the style element will eventually allow for you to include style elements mid-document. To do this, you must mark up your style element with the scoped attribute.&#60;/p&#62;
  &#60;section&#62;
    &#60;style <mark>scoped</mark>&#62;
      p { color: red; }
    &#60;/style&#62;
    &#60;h2&#62;How does it work?&#60;/h2&#62;
    &#60;p&#62;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.&#60;/p&#62;
  &#60;/section&#62;
&#60;/article&#62;</code></pre>

<aside class="sidenote"><p>It’s worth noting that the <code>scoped</code> attribute can’t be the first attribute of the body element. I also received a validation error using <code>&#60;body style="..."&#62;</code>.</p></aside>

<p id="example">This screenshot shows how things might render in the browser:</p>

<figure>
<img src="http://html5doctor.com/wp-content/uploads/2011/09/scoped1.gif" alt="" title="scoped" width="526" height="297" class="alignnone size-full wp-image-3735" />
<figcaption>How the <code>scoped</code> attribute will render</figcaption>
</figure>
</section>
</section>

<section id="link">
<h2>Can I apply <code>scoped</code> to &#60;link&#62;?</h2>
<p>While I was writing this article, Dr. Rich asked whether it was possible to add this attribute to <code>&lt;link&gt;</code> elements. Turns out you can’t, but I stumbled across this tidbit in the WHATWG mailing list:</p>

<blockquote>
  <p>You can use &#60;style scoped&#62;@import url(whatever);&#60;/style&#62;</p>
  <p>And this even enables you to add some specific styles ([be they embedded] or from another external sheet) on a per-use basis if the need arises. For example, a long dissertation relying on many quotes may benefit from adding stronger visual highlights on the &#60;em&#62; elements within the last quote to reinforce the final conclusion.</p>
  <footer>— <cite><a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-March/031049.html"> Eduard Pascuals WHATWG mailing list response #031049</a></cite></footer>
</blockquote>
</section>

<section id="compatibility">
<h2>Backwards compatibility</h2>	
<p>Unfortunately, scoped style isn’t all puppy dogs and kittens.</p>

<p>Since this newly introduced attribute isn’t understood by current browsers, CSS rules in <code>&#60;style scoped&#62;</code> are just added to the page’s CSS. Therefore, if you were to include a <code>scoped</code> style block mid-page, its declarations would be applied to every matching element in the document, regardless of whether the element were inside or outside of the scope’s range.</p>

<p>For the sake of backwards compatibility, Louis Lazaris has suggested <a href="http://www.impressivewebs.com/scoped-styles-html5/">a brand new element called <code>&#60;scopedstyle&#62;</code></a>. This new element would only be recognised by supporting browsers and ignored by everything else. This way, scoped styles wouldn’t be added to the whole document. Instead, the browser would just throw away the unrecognised <code>&lt;scopedstyle&gt;</code> element and move on.</p>
</section>

<section id="support">
<h2>Browser support</h2>

<table class="wide">
<caption>Browser support for <code>&lt;style scoped&gt;</code> <i>(as of <time datetime="2011-09-06">6th September, 2011</time>)</i></caption>
<thead>
<tr>
<th scope="col">Browser</th>
<th scope="col">Support</th>
</tr>
</thead>
<tbody>
<tr>
  <th scope="row">Chrome 13</th>
  <td>No</td>
</tr>
<tr>
  <th scope="row">Safari 5</th>
  <td>No</td>
</tr>
<tr>
  <th scope="row">Firefox 6</th>
  <td>No</td>
</tr>
<tr>
  <th scope="row">Opera 11.51</th>
  <td>No</td>
</tr>
<tr>
  <th scope="row">Internet Explorer 9</th>
  <td>No</td>
</tr>
</tbody>
</table>

<p>Currently, the <code>scoped</code> attribute isn’t working in any of the browser alpha versions (Opera.Next, Mozilla Aurora, or WebKit nightly builds). There’s work in progress by <a href="https://bugs.webkit.org/show_bug.cgi?id=49142">Roland Steiner for support in WebKit</a>.</p>
</section>

<section id="using-today">
<h2>Using <code>&#60;style scoped&#62;</code> today</h2>
<p>So you’ve read this article and decided that you <em>need</em> scoped style in your life. What now? Well, just like every other new HTML5 thing, we have a polyfill for it. <a href="http://twitter.com/#!/thingsinjars">Simon Madine</a> has created a <a href="https://github.com/thingsinjars/jQuery-Scoped-CSS-plugin">jQuery scoped CSS plugin on GitHub</a>.</p>

<aside class="sidenote"><p>Please note that Oli used a wrapper <code>&lt;div&gt;</code> because of <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=13102">validation problems explained in this bug</a>.</p></aside>

<p>You could also assign a CSS prefix to target the section of your document you want to style. You’d still be able to stick your styles inline, but you’ve also provided a fallback for the older browsers. In fact, Dr. Oli has done just that on his <a href="http://html5doctor.com/blockquote-q-cite/">latest article</a>. (View source and search for <code>&#60;div class="faint"&#62;</code>.)</p>
</section>

<section id="opinions">
<h2>Opinions</h2>

<p>There’s no denying that we’re breaking backwards compatibility by introducing <code>&lt;style scoped&gt;</code>. To me, this just doesn’t make any sense. I feel this needs to be addressed by either creating a new element like <code>&lt;scopedstyle&gt;</code> or using some protective mechanism like the <code>&#60;!--</code> and <code>--&#62;</code> delimiters that have been used within <code>&lt;style&gt;</code> and <code>&lt;script&gt;</code> elements.</p>

<p>Let’s not end this article with negative sentiment, though. As with anything, it’s what you make of it. Scoped style is pretty plain vanilla, but if people abuse it, it’ll end up with a bad rap. <a href="http://html5doctor.com/author/olib/">Dr. Oli</a> has spoken at length about his love for this attribute as it allows him to have live code examples with the CSS in <code>&#60;pre&#62;</code> and also in a <code>&#60;style scoped&#62;</code> within a <code>&#60;figure&#62;</code>.</p>

<p>So now it’s time for you to express your views. What do you think about the new <code>scoped</code> attribute? Do you think it has a future? Should it be fast-tracked into the spec? Or do you think it’s a waste of time that could ultimately end up mixing our content and presentation layers together again? Let us know in the comments!</p>
</section><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/the-contenteditable-attribute/" rel="bookmark" class="crp_title">The contenteditable attribute</a></li><li><a href="http://html5doctor.com/u-element/" rel="bookmark" class="crp_title">The return of the u element</a></li><li><a href="http://html5doctor.com/the-details-and-summary-elements/" rel="bookmark" class="crp_title">The details and summary elements</a></li><li><a href="http://html5doctor.com/blockquote-q-cite/" rel="bookmark" class="crp_title">Quoting and citing with <code>&lt;blockquote&gt;</code>, <code>&lt;q&gt;</code>, <code>&lt;cite&gt;</code>, and the cite attribute</a></li><li><a href="http://html5doctor.com/the-output-element/" rel="bookmark" class="crp_title">The output element</a></li></ul></div><p><a href="http://html5doctor.com/the-scoped-attribute/" rel="bookmark">The scoped attribute</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on September 13, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/the-scoped-attribute/feed/</wfw:commentRss>
		<slash:comments>66</slash:comments>
		</item>
		<item>
		<title>Quoting and citing with &lt;blockquote&gt;, &lt;q&gt;, &lt;cite&gt;, and the cite attribute</title>
		<link>http://html5doctor.com/blockquote-q-cite/</link>
		<comments>http://html5doctor.com/blockquote-q-cite/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 13:30:21 +0000</pubDate>
		<dc:creator>Oli Studholme</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[blockquote]]></category>
		<category><![CDATA[cite]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[q]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=3373</guid>
		<description><![CDATA[<p>Given HTML’s roots in the academic world, it should be no surprise that quoting is well-accomodated in the elements blockquote and q, with their optional cite attribute. In addition, there’s the cite element, which over the last nine years went from ‘semantic orphan element made good’ to one of the more contentious elements in HTML5. Let’s power up the endoscope and examine the scarring, starting with blockquote.</p>]]></description>
			<content:encoded><![CDATA[<p>Given HTML’s roots in the academic world, it should be no surprise that quoting is well-accommodated in the elements <code>&lt;blockquote&gt;</code> and <code>&lt;q&gt;</code>, with their optional <code>cite</code> attribute. In addition, there’s the <code>&lt;cite&gt;</code> element, which over the last nine years went from ‘semantic orphan element made good’ to one of the more contentious elements in HTML5. Let’s power up the endoscope and examine the scarring, starting with <code>&lt;blockquote&gt;</code>.</p>

<section id="blockquote">
<h2>Quoting with <code>&lt;blockquote&gt;</code> <a class="permalink" href="#blockquote">#</a></h2>

<p>We’ve become pretty familiar with <code>&lt;blockquote&gt;</code> here, as most of our articles feature excerpts from the HTML5 specification. Look, here’s one right now:</p>

<blockquote>
<p>The <code>blockquote</code> element represents a section that is quoted from another source.</p>
<footer>— <cite><a href="http://dev.w3.org/html5/spec/grouping-content.html#the-blockquote-element" title="4.5 Grouping content &#8212; HTML5">W3C HTML5 specification</a></cite></footer>
</blockquote>

<p>Easy peasy, right? Nothing has really changed. Remember that as <code>&lt;blockquote&gt;</code> is a ‘block-level element’ (<em>flow content</em>) we can put most anything in it, including headers, images and tables, in addition to the usual paragraphs of text.</p>

<p>There are a couple of slight differences in HTML5 though. <code>&lt;blockquote&gt;</code> is a <em>sectioning root</em>, meaning that any <code>&lt;h1&gt;</code>-<code>&lt;h6&gt;</code> elements it contains don’t become part of the document’s outline. Also, adding a single paragraph of text with no enclosing <code>&lt;p&gt;</code> tags is now completely kosher.</p>

<p>Here are some simple <code>&lt;blockquote&gt;</code> examples (apologies for the fake content):</p>

<figure>
<pre><code>&lt;blockquote&gt;This is a short block quote — look Ma, no paragraph tags!&lt;/blockquote&gt;</code></pre>
<blockquote>This is a short block quote — look Ma, no paragraph tags!</blockquote>
</figure>

<figure>
<pre><code>&lt;blockquote&gt;&lt;p&gt;This is a longer block quote.&lt;/p&gt;
  &lt;p&gt;It uses paragraph elements.&lt;/p&gt;
&lt;/blockquote&gt;</code></pre>
<blockquote><p>This is a longer block quote.</p>
<p>It uses paragraph elements.</p></blockquote>
</figure>

<figure>
<pre><code>&lt;blockquote&gt;&lt;h1&gt;OMG a heading!&lt;/h1&gt;
  &lt;ul&gt;&lt;li&gt;Block quotes can contain more than just paragraphs…&lt;/li&gt;&lt;/ul&gt;
&lt;/blockquote&gt;</code></pre>
<blockquote><h1>OMG a heading!</h1>
  <ul><li>Block quotes can contain more than just paragraphs…</li></ul>
</blockquote>
</figure>

<p>Historically, adding the source of a <code>&lt;blockquote&gt;</code> was a semantic conundrum. If you add it as content of the <code>&lt;blockquote&gt;</code>, then semantically it would become part of the quote, right? <code>&lt;blockquote&gt;</code> (and <code>&lt;q&gt;</code>) have a <code>cite</code> attribute for the URL of the quote’s source, to provide context. That’s hidden data, however, and despite <a href="http://www.holovaty.com/writing/176/">the potential for exposing the <code>cite</code> attribute via CSS and/or JS</a>, that’s not as useful as a visible link.</p>

<div class="callout warning-block">
<aside class="sidenote"><p><em>Non-conforming</em> means that while it will validate, adding a <code>&lt;footer&gt;</code> that isn’t in the quote’s source goes against the spec</p></aside>
<p><ins datetime="2011-07-11T14:48:12+0900">It seems our long-running convention at HTML5 Doctor of using <code>&lt;footer&gt;</code> for attribution inside a <code>&lt;blockquote&gt;</code> is actually <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=13082" title="Bug 13082"><em>non-conforming</em></a>. However the phrase in the spec that prevents it also prevents other common block quoting patterns, so the spec will probably change. Read my article <a href="http://oli.jp/2011/blockquote/" title="Blockquote problems and solutions ❧ Oli.jp (@boblet)"><code>&lt;blockquote&gt;</code> problems and solutions</a>, and submit <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-July/032334.html" title="[whatwg] The blockquote element spec vs common quoting practices">feedback via the WHATWG email list</a>, the comments here or to be via <a href="http://twitter.com/boblet">Twitter (@boblet)</a> — your feedback will influence <em>how</em> the spec changes!</ins></p>
<p><ins datetime="2011-07-11T14:48:28+0900">I’ll <a href="#updates">update this article</a> after the change, but until then be aware <strong><code>&lt;footer&gt;</code> for attribution in a <code>&lt;blockquote&gt;</code> isn’t strictly valid</strong>, and may not be in the future either. The spec currently recommends including attribution in content surrounding the <code>&lt;blockquote&gt;</code>.</ins></p>
</div>

<div class="faint">
<style scoped>
.faint {color: #777;}
</style>
<p>HTML5 comes to our rescue with the <code>&lt;footer&gt;</code> element, allowing us to add semantically separate information <em>about</em> the quote. For example:</p>

<figure>
<pre><code>&lt;blockquote&gt;
  &lt;p&gt;You know the golden rule, don’t you boy? Those who have the gold make the rules.&lt;/p&gt;
  &lt;footer&gt;— Crazy hunch-backed old guy from the movie Aladdin&lt;/footer&gt;
&lt;/blockquote&gt;
</code></pre>
<blockquote>
  <p>You know the golden rule, don’t you boy? Those who have the gold make the rules.</p>
  <footer>— Crazy hunch-backed old guy from the movie Aladdin</footer>
</blockquote>
</figure>

<p>Because of this semantically sound way to show the quote’s source, <ins datetime="2011-07-11T14:34:56+0900">if you’re going to add a <code>cite</code> attribute on <code>&lt;blockquote&gt;</code>, only do so <em>in addition</em> to visible attribution</ins>.</p>

<figure>
<pre><code>&lt;blockquote cite="http://www.imdb.com/character/ch0000672/quotes"&gt;
&lt;p&gt;You know the golden rule, don’t you boy? Those who have the gold make the rules.&lt;/p&gt;
&lt;footer&gt;— &lt;a href="http://www.imdb.com/character/ch0000672/quotes"&gt;Crazy hunch-backed old guy in Aladdin&lt;/a&gt;&lt;/footer&gt;
&lt;/blockquote&gt;
</code></pre>
<blockquote>
<p>You’ve heard of the golden rule, haven’t you? Whoever has the gold makes the rules.</p>
<footer>— <a href="http://www.imdb.com/character/ch0000672/quotes">Crazy hunch-backed old guy in Aladdin</a></footer>
</blockquote>
</figure>
</div>

<p>Even then, the <code>cite</code> attribute is probably only worth it if you can automate it (or you're just crazy OCD <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . We’ll return to <code>&lt;blockquote&gt;</code> in a bit, but let’s first probe into <code>&lt;q&gt;</code>.</p>

<!-- /#blockquote --></section>

<section id="q">
<h2>Inline quotations with <code>&lt;q&gt;</code> <a class="permalink" href="#q">#</a></h2>

<p><code>&lt;q&gt;</code> is for quoting something inline within a section of prose:</p>

<blockquote>
<p>The <code>q</code> element represents some phrasing content quoted from another source.</p>
<footer>— <cite><a href="http://dev.w3.org/html5/spec/text-level-semantics.html#the-q-element" title="4.6 Text-level semantics &#8212; HTML5">W3C HTML5 specification</a></cite></footer>
</blockquote>

<p>This means we can’t use <code>&lt;q&gt;</code> for sarcasm or other non-quotation uses of quote marks (“”). In those cases, add punctuation manually.</p>
  
<p>The spec continues:</p>

<blockquote>
<p>Quotation punctuation (such as quotation marks) that is quoting the contents of the element must not appear immediately before, after, or inside <code>q</code> elements; they will be inserted into the rendering by the user agent.</p>
<footer>— <cite><a href="http://dev.w3.org/html5/spec/text-level-semantics.html#the-q-element" title="4.6 Text-level semantics &#8212; HTML5">W3C HTML5 specification</a></cite></footer>
</blockquote>

<p>As with <code>&lt;blockquote&gt;</code>, you can also add a <code>cite</code> attribute with a URL for the quotation’s source (subject to the above caveats against hidden data). If you’re not using these extra features though, it’s a toss-up as to whether <code>&lt;q&gt;</code> is any better than just adding punctuation characters like “” as you type.</p>

<p>Okay, let’s see some specimens:</p>

<figure>
  <figcaption>Nested quotations:</figcaption>
<pre><code>&lt;p&gt;Luke continued, &lt;q&gt;And then she called him a &lt;q&gt;scruffy-looking nerf-herder&lt;/q&gt;! I think I’ve got a chance!&lt;/q&gt; The poor naive fool…&lt;/p&gt;
</code></pre>
<p>Luke continued, <q>And then she called him a <q>scruffy-looking nerf-herder</q>! I think I’ve got a chance!</q> The poor naive fool…</p>
</figure>

<div class="lang-example">
<style scoped>
.lang-example :lang(ja) > q {quotes: '「' '」' '『' '』';}
.lang-example :lang(ja-latn) > q {quotes: '“' '”' '‘' '’';}
</style>
<figure>
<figcaption>Language-appropriate quotations <ins datetime="2011-06-29T13:32:48+09:00">(example updated, thanks <a href="#comment-15413">Zev</a> &amp; <a href="#comment-15433">Bertil</a>)</ins>:</figcaption>
<aside class="sidenote"><p><ins datetime="2011-06-29T13:32:48+09:00">For more information see <a href="#foreign-languages">styling foreign quotations</a></ins></p></aside>
<pre><code>&lt;ul&gt;
&lt;li lang="ja"&gt;彼女は&lt;q&gt;猫は『にゃん』と鳴く&lt;/q&gt;と言った。&lt;/li&gt;
&lt;li&gt;&lt;i lang="ja-latn"&gt;Kanojo wa &lt;q&gt;Nihongo ni neko wa “nyan” to naku&lt;/q&gt; to itta.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;She said &lt;q&gt;In Japanese cats say &lt;i lang="ja-latn"&gt;nyan&lt;/i&gt;&lt;/q&gt;.&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<ul class="semantic-list">
<li lang="ja">彼女は<q>猫は『にゃん』と鳴く</q>と言った。</li>
<li><i lang="ja-latn">Kanojo wa <q>Nihongo ni neko wa “nyan” to naku</q> to itta.</i></li>
<li>She said <q>In Japanese cats say <i lang="ja-latn">nyan</i></q>.</li>
</ul>
</figure>
</div>
<figure>
<figcaption>A quotation using the cite attribute. Note that I’ve also included the <code>cite</code> attribute’s link in content so it’s accessible:</figcaption>
<pre><code>&lt;p&gt;&lt;a href="http://www.imdb.com/character/ch0000672/quotes"&gt;The Aladdin character Jafar&lt;/a&gt; presents an eloquent treatise on the recent global economic meltdown when he states &lt;q cite="http://www.imdb.com/character/ch0000672/quotes"&gt;You know the golden rule, don’t you boy? Those who have the gold make the rules.&lt;/q&gt;&lt;/p&gt;</code></pre>
<p><a href="http://www.imdb.com/character/ch0000672/quotes" title="Jafar (Character) - Quotes">The Aladdin character Jafar</a> presents an eloquent treatise on the recent global economic meltdown when he states <q cite="http://www.imdb.com/character/ch0000672/quotes">You know the golden rule, don’t you boy? Those who have the gold make the rules.</q></p>
</figure>

<p>Let’s examine how to style these elements next.</p>

<!-- /#q --></section>

<section id="styling">
<h2>Styling <code>&lt;q&gt;</code> and <code>&lt;blockquote&gt;</code> <a class="permalink" href="#styling">#</a></h2>

<p>Historically, browser support has been patchy for controlling the punctuation used by <code>&lt;q&gt;</code>. Things have settled down now, so we can define nested, language-specific and even author-defined punctuation via CSS.</p>

<table id="quotes-support" class="browser-support wider">
<caption>Browser support for styling quotes</caption>
<thead>
<tr>
  <th scope="col"></th>
  <th scope="col"><abbr title="Internet Explorer">IE</abbr></th>
  <th scope="col">Firefox</th>
  <th scope="col">Safari</th>
  <th scope="col">Chrome</th>
  <th scope="col">Opera</th>
</tr>
</thead>
<tbody>
<tr>
  <th scope="row">Default <code>&lt;q&gt;</code> punctuation<a href="#quotes-1">¹</a></th>
  <td>8.0 “” ‘’</td>
  <td>1.5 “” ‘’</td>
  <td>2.0 ""<br />
    4.0? "" ''</td>
  <td>1.0? "" ''</td>
  <td>4.0 “” ‘’</td>
</tr>
<tr>
  <th scope="row"><code>quotes</code> with Unicode escapes</th>
  <td>8.0</td>
  <td>1.5</td>
  <td>5.1<a href="#quotes-2">²</a></td>
  <td>11.0<a href="#quotes-2">²</a></td>
  <td class="warning">4.0<a href="#quotes-3">³</a></td>
</tr>
<tr>
  <th scope="row"><code>quotes</code> with glyphs</th>
  <td>8.0</td>
  <td>1.5</td>
  <td>5.1<a href="#quotes-2">²</a></td>
  <td>11.0<a href="#quotes-2">²</a></td>
  <td class="warning">4.0<a href="#quotes-3">³</a></td>
</tr>
</tbody>
</table>

<ol class="key">
<li id="quotes-1">Default <code>&lt;q&gt;</code> support requires on <code>:before</code> and <code>:after</code></li>
<li id="quotes-2">Webkit support has been weak, with "" and '' hard-coded until Safari 5.1 and Chrome 11. Ref: WebKit bugs <a href="https://bugs.webkit.org/show_bug.cgi?id=6503">6503 (fixed)</a> and <a href="https://bugs.webkit.org/show_bug.cgi?id=3234">3234 (new)</a>.</li>
<li id="quotes-3">Opera is buggy if you nest <code>&lt;q&gt;</code> to a greater depth than quote pairs in your <code>quotes</code> property (<a href="http://jsbin.com/ehevof">test case</a>)</li>
</ol>

<p>“Correct” punctuation is an intricate topic and <a href="http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks" title="Non-English usage of quotation marks - Wikipedia, the free encyclopedia">varies depending on language</a>, but it generally involves these characters:</p>

<table id="punctuation-characters" class="widest">
<caption>Quote punctuation characters</caption>
<thead>
<tr>
<th scope="col">Glyph</th>
<th scope="col">Description</th>
<th scope="col">Unicode escape</th>
<th scope="col">Entity</th>
<th scope="col">Mac</th>
<th scope="col">Windows</th>
<th scope="col">Linux</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">“</th>
<td>Left double quotation mark</td>
<td>\201C</td>
<td><code>&amp;ldquo;</code></td>
<td><kbd>Option</kbd>-<kbd>[</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0147</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>V</kbd></td>
</tr>
<tr>
<th scope="row">”</th>
<td>Right double quotation mark</td>
<td>\201D</td>
<td><code>&amp;rdquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>[</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0148</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>B</kbd></td>
</tr>
<tr>
<th scope="row">‘</th>
<td>Left single quotation mark</td>
<td>\2018</td>
<td><code>&amp;lsquo;</code></td>
<td><kbd>Option</kbd>-<kbd>]</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0145</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>Shift</kbd>+<kbd>V</kbd></td>
</tr>
<tr>
<th scope="row">’</th>
<td>Right single quotation mark</td>
<td>\2019</td>
<td><code>&amp;rsquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>]</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0146</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd></td>
</tr>
<tr>
<th scope="row">«</th>
<td>Double left-pointing angle quotation mark</td>
<td>\00AB</td>
<td><code>&amp;laquo;</code></td>
<td><kbd>Option</kbd>-<kbd>\</kbd></td>
<td><kbd>Alt</kbd>+<kbd>174</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>[</kbd></td>
</tr>
<tr>
<th scope="row">»</th>
<td>Double right-pointing angle quotation mark</td>
<td>\00BB</td>
<td><code>&amp;raquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>\</kbd></td>
<td><kbd>Alt</kbd>+<kbd>175</kbd></td>
<td><kbd>AltGr</kbd>+<kbd>]</kbd></td>
</tr>
<tr>
<th scope="row">‹</th>
<td>Single left-pointing angle quotation mark</td>
<td>\2039</td>
<td><code>&amp;lsaquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>3</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0139</kbd></td>
<td>-</td>
</tr>
<tr>
<th scope="row">›</th>
<td>Single right-pointing angle quotation mark</td>
<td>\203A</td>
<td><code>&amp;rsaquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>4</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0155</kbd></td>
<td>-</td>
</tr>
<tr>
<th scope="row">„</th>
<td>Double low-9 quotation mark</td>
<td>\201E</td>
<td><code>&amp;bdquo;</code></td>
<td><kbd>Option</kbd>-<kbd>Shift</kbd>-<kbd>W</kbd></td>
<td><kbd>Alt</kbd>+<kbd>0132</kbd></td>
<td>-</td>
</tr>
<tr>
<th scope="row">‚</th>
<td>Single low-9 quotation mark</td>
<td>\201A</td>
<td><code>&amp;sbquo;</code></td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th scope="row"> </th>
<td>Narrow no-break space</td>
<td>\202F</td>
<td><code>&amp;#8239;</code></td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
</tbody>
</table>

<aside class="sidenote"><p><a href="http://www.georgehernandez.com/h/xComputers/CharacterSets/Shortcuts.asp" title="Shortcuts by George Hernandez">More info on keyboard shortcuts for entering special characters</a>, including how to enter them via Unicode escape codes (hex input) on Macs &amp; PCs</p></aside>
<p class="note">If you’re using the <code>charset</code> UTF-8 (and you should be), we recommend you use the actual characters if possible, rather than the Unicode escapes in CSS or the entities in HTML. You can enter most of these using the keyboard — e.g. “ is <kbd>Opt</kbd>-<kbd>[</kbd> on Mac, <kbd>Alt</kbd> + <kbd>0147</kbd> on Windows, and <kbd>AltGr</kbd> + <kbd>V</kbd> on Linux. Avoid using ", ' or ` in place of “” and ‘’. The “narrow no-break space” is used inside French guillemets.</p>

<p>Most languages alternate between two kinds of punctuation as quotes are nested, such as “” and ‘’ in English. To specify nested quote pairs in CSS, we would write this:</p>

<pre><code>q {quotes: '“' '”' '‘' '’';} /* opening followed by closing quote pairs */
/* The equivalent using Unicode escapes:
  q {quotes: '\201C' '\201D' '\2018' '\2019';} */
q:before {content: open-quote;}
q:after {content: close-quote;}
</code></pre>

<p>Unfortunately, browsers use the last quote pair in the <code>quotes</code> property for more deeply nested quotations. <ins datetime="2011-06-29T00:17:49+09:00">In addition, Opera will use the wrong quote characters if you have more nested <code>&lt;q&gt;</code> than your <code>quotes</code> property defines quoting levels for (<a href="http://jsbin.com/ehevof">Opera quotes bug test case</a>).</ins> Make sure you have enough levels by repeating quote pairs as necessary:</p>

<pre><code>/* four levels of nested quotes */
q {quotes: '“' '”' '‘' '’' '“' '”' '‘' '’';}</code></pre>

<p>WebKit had "" and '' hard-coded in the browser stylesheet until Safari 5.1 and Chrome 11, which prevented <code>q:before {content: open-quote;}</code> and <code>q:after {content: close-quote;}</code> from working. <a href="http://yuilibrary.com/projects/yui3/ticket/2528708" title="#2528708 Issues with quotes : reset.css : YUI Library">The workaround is to define opening and closing punctuation manually</a>, then override with <code>open-quote</code> and <code>close-quote</code>. While it’s a little more involved, that’s why we use this CSS on HTML5 Doctor:</p>

<pre><code>/* for two levels of nested quotations */
q {quotes: '“' '”' '‘' '’';}
 /* extra content definitions for pre-2011 WebKit */
q:before {content: '“'; content: open-quote;}
q:after {content: '”'; content: close-quote;}
q q:before {content: '‘'; content: open-quote;}
q q:after {content: '’'; content: close-quote;}
  /* q in blockquote */
blockquote q:before {content: '‘'; content: open-quote;}
blockquote q:after {content: '’'; content: close-quote;}
blockquote q q:before {content: '“'; content: open-quote;}
blockquote q q:after {content: '”'; content: close-quote;}
  /* blockquote hanging opening quote */
blockquote:before {display: block; height: 0; content: "“"; margin-left: -.95em; font: italic 400%/1 Cochin,Georgia,"Times New Roman",serif; color: #999;}
</code></pre>

<p>A more traditional English <code>&lt;blockquote&gt;</code> style uses an opening quote character before each paragraph of the quotation and a closing quote character on the last paragraph. You can do that with this CSS, but you’ll need to use <code>&lt;p&gt;</code> for the <code>&lt;blockquote&gt;</code>’s content.</p>

<pre><code>/* alternative blockquote style */
blockquote {quotes: '“' '”';}
blockquote p:before {content: '“'; content: open-quote;}
blockquote p:after {content: ''; content: no-close-quote;}
blockquote p:last-child:after {content: '”'; content: close-quote;}
</code></pre>

<p id="foreign-languages">When quoting a foreign language, we use the quotation marks of the surrounding language, so a Japanese quote in an English sentence still uses English quotation marks:</p>

<p class="callout">All he knows how to say in Japanese is <del>「わかりません」</del> <ins>“わかりません”</ins> (I don’t understand).</p>

<p>If you’re dealing with multilingual content, you can specify the <code>quotes</code> property per-language:</p>

<pre><code>/* quotes for French, German (two kinds) and Japanese */
:lang(fr) > q {quotes: '«&#8239;' '&#8239;»' '“' '”';}
:lang(de) > q {quotes: '„' '“' '‚' '‘';}
:lang(de) > q {quotes: '»' '«' '›' '‹';} /* alternative style */
:lang(ja) > q {quotes: '「' '」' '『' '』';}
</code></pre>

<p>You can learn more about this CSS in the specification: <a href="http://dev.w3.org/csswg/css3-content/#specifying-quotes-with-the-quotes-proper" title="CSS Generated Content Module Level 3">CSS Generated Content Module Level 3</a>.</p>

<p>Okay, it’s time to put the rubber gloves on: <code>&lt;cite&gt;</code> is up next.</p>

<!-- /#styling --></section>

<section id="cite">
<h2>The rise and fall of <code>&lt;cite&gt;</code> <a class="permalink" href="#cite">#</a></h2>

<section id="cite-history">
<h3><code>&lt;cite&gt;</code>’s rise to stardom as the semantic super-element <a class="permalink" href="#cite-history">#</a></h3>

<p><a href="http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.7.1.1">In HTML 2</a> <code>&lt;cite&gt;</code> was <q cite="http://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.7.1.1">used to indicate the title of a book or other citation</q>. But in HTML 3.2 and HTML 4.01, <code>&lt;cite&gt;</code> was more loosely defined as</p>

<blockquote><p>Cite: Contains a citation or a reference to other sources</p>
<footer>— <a href="http://www.w3.org/TR/html401/struct/text.html#edef-CITE" title="Paragraphs, Lines, and Phrases">HTML 4.01 specification</a></footer>
</blockquote>

<p>We can define “citation” as:</p>

<ul>
<li>a reference to authority or precedent,</li>
<li>a quotation that’s being cited, or</li>
<li>a mention of someone or something</li>
</ul>

<p>And “a reference to other sources” is even less specific [cue Jaws music]. The <a href="http://www.w3.org/TR/html401/struct/text.html#edef-CITE" title="Paragraphs, Lines, and Phrases">HTML 4.01 spec’s examples</a> were:</p>

<blockquote>
<p>As <code>&lt;CITE&gt;</code>Harry S. Truman<code>&lt;/CITE&gt;</code> said…</p>
<p>More information can be found in <code>&lt;CITE&gt;</code>[ISO-0000]<code>&lt;/CITE&gt;</code></p>
</blockquote>

<p>Sadly, an example of an academic-style citation wasn’t included.</p>

<p>Some standardistas enthusiastically adopted <code>&lt;cite&gt;</code> for its semantics, with the high point being <a href="http://diveintomark.org/archives/2002/12/27/pushing_the_envelope">Mark Pilgrim’s epic “Posts by citation”</a> (the results of which are now sadly 404’ed). In those heady days, <code>&lt;cite&gt;</code> was used in three main ways:</p>
<ol>
<li>
<p>To refer to a person, generally in connection with some reference or as the source of a quote:</p>
<pre class="callout warning-block"><code>&lt;!-- Not valid usage of cite in HTML5! --&gt;
&lt;p&gt;As &lt;cite&gt;George R. R. Martin&lt;/cite&gt; wrote in…&lt;/p&gt;</code></pre>
</li>
<li>
<p>To contain the title of a work being referred to or quoted from <ins datetime="2011-06-29T00:54:20+09:00">(what <code>&lt;cite&gt;</code> is now used for in HTML5 — <a href="http://html5doctor.com/blockquote-q-cite/#comment-15397">thanks Dylan</a>!)</ins>:</p>
<pre class="callout changed-block"><code>&lt;p&gt;&lt;cite&gt;A Game of Thrones&lt;/cite&gt;, by George R. R. Martin&lt;/p&gt;</code></pre>
</li>
<li>
<p>To contain a full academic-style citation (title plus author, and maybe bibliographic information):</p>
<pre class="callout warning-block"><code>&lt;!-- Not valid usage of cite in HTML5! --&gt;
&lt;p&gt;&lt;cite&gt;A Game of Thrones, by George R. R. Martin&lt;/cite&gt;&lt;/p&gt;</code></pre>
<ul>
<li>
<p>Historically this might also be marked up as:</p>
<pre class="callout warning-block"><code>&lt;!-- Not valid usage of cite in HTML5! --&gt;
&lt;p&gt;&lt;cite class="book-title"&gt;A Game of Thrones&lt;/cite&gt;, by &lt;cite class="author"&gt;George R. R. Martin&lt;/cite&gt;&lt;/p&gt;</code></pre>
</li>
<li>
<p>or <a href="http://en.wikipedia.org/wiki/Template:Quotation" title="Template:Quotation - Wikipedia, the free encyclopedia">as Wikipedia does</a> (with <code>&lt;cite&gt;</code> set to <code>font-style: normal;</code>):</p>
<pre class="callout warning-block"><code>&lt;!-- Not valid usage of cite in HTML5! --&gt;
&lt;p&gt;&lt;cite&gt;George R. R. Martin, &lt;i&gt;A Game of Thrones&lt;/i&gt;&lt;/cite&gt;&lt;/p&gt;</code></pre>
</li>
</ul>
</li>
</ol>

<p>“Wow, what an all-rounder!” I hear you say. “Is there anything <code>&lt;cite&gt;</code> can’t do?” The dirty secret of all this is the <code>&lt;cite&gt;</code> element has historically been semantics for the sake of semantics. So far, the only non-site-specific application of <code>&lt;cite&gt;</code> is browser default stylesheets, which format it with <code>font-style: italic;</code>. This is not a bad thing, as using <code>&lt;cite&gt;</code> consistently on your own site allows you to do all kinds of fun stuff (as Pilgrim demonstrated). But in the past, it’s been used to refer to <em>three related but quite different types of data:</em> titles, full citations, and names. This makes web-wide use, such as by a search engine, tricky.</p>

<!-- /#cite-history --></section>

<section id="cite-future">
<h3><code>&lt;cite&gt;</code> snorts too much semantics, checks into rehab <a class="permalink" href="#cite-future">#</a></h3>

<p>So, in HTML5 this semantic over-achiever has ended up with a more … prosaic definition:</p>

<blockquote>
<p>The cite element represents the title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script, a film, a TV show, a game, a sculpture, a painting, a theatre production, a play, an opera, a musical, an exhibition, a legal case report, etc). This can be a work that is being quoted or referenced in detail (i.e. a citation), or it can just be a work that is mentioned in passing.</p>
<p><mark>A person's name is not the title of a work</mark> — even if people call that person a piece of work — <mark>and the element must therefore not be used to mark up people's names</mark></p>
<footer>— <cite><a href="http://dev.w3.org/html5/spec/text-level-semantics.html#the-cite-element" title="4.6 Text-level semantics &#8212; HTML5">W3C HTML5 specification</a></cite></footer>
</blockquote>

<aside class="sidenote"><p><q>A piece of work</q>, heh, that’s good</p></aside>

<p>This restriction has been somewhat … unpopular. Arguments for using <code>&lt;cite&gt;</code> for names (<a href="http://wiki.whatwg.org/wiki/Cite_element">now summarised on the <span class="caps">WHATWG</span> wiki</a>) were <a href="http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-February/014008.html">addressed by Ian Hickson</a>, who decided that historical use wasn’t enough to justify the wooly definition. <a href="http://24ways.org/2009/incite-a-riot" title="24 ways: Incite A Riot">Jeremy Keith’s 24 Ways article “<cite>Incite A Riot</cite>”</a> called for civil disobedience and HTML 4.01-style <code>&lt;cite&gt;</code>-ing, but the HTML5 spec has not changed.</p>


<p>The in<code>&lt;cite&gt;</code>rs are irate that there are two use cases that <code>&lt;cite&gt;</code>’s new definition leaves semantically unfilled — to mark up speakers in a transcript or dialog, and to indicate the speaker or author of an inline quote (<code>&lt;q&gt;</code>). The <a href="http://dev.w3.org/html5/spec/text-level-semantics.html#the-cite-element" title="4.6 Text-level semantics &#8212; HTML5">HTML5 spec</a> adds semantic insult to injury by saying:</p>

<blockquote>
<p>In some cases, the <code>&lt;b&gt;</code> element might be appropriate for names; e.g. in a gossip article … In other cases, if an element is really needed, the <code>&lt;span&gt;</code> element can be used.</p>
</blockquote>

<p>By better defining <code>&lt;cite&gt;</code>, we increase the odds of getting usable data from it, though we now need different methods to cover these other uses. For now, it seems that these use cases aren’t specific enough to warrant new elements.</p>

<p>Note that <code>&lt;cite&gt;</code> was never a general-purpose element for marking up a person. The still-born HTML 3.0 did try to introduce the <code>&lt;person&gt;</code> element, but if you’ve ever used hCard to semantically mark up a person’s name, you’ll know that we’d need way more than just one element to do names justice. The <abbr title="plain old semantic HTML">POSH</abbr> way of marking up a name is to use hCard (in <a href="http://html5doctor.com/microformats/" title="Extending HTML5 — Microformats | HTML5 Doctor">microformats</a>, <a href="http://html5doctor.com/microdata" title="Extending HTML5 — Microdata | HTML5 Doctor">microdata</a> or RDFa), or just with a plain old link.</p>

<!-- /#cite-future --></section>

<section id="cite-examples">
<h3>Get ex<code>&lt;cite&gt;</code>d and quote stuff <a class="permalink" href="#cite-examples">#</a></h3>

<p>History and encouraging angry comments aside, let’s suture up and see some examples of HTML5-style <code>&lt;cite&gt;</code> action:</p>

<figure>
<figcaption>Use <code>&lt;cite&gt;</code> for a movie title:</figcaption>
<pre><code>&lt;p&gt;&lt;cite&gt;Aladdin&lt;/cite&gt; is a great movie, even after 73 viewings. Aren’t kids great?&lt;/p&gt;</code></pre>
<p><cite>Aladdin</cite> is a great movie, even after 73 viewings. Aren’t kids great?</p>
</figure>

<figure>
<figcaption>Even better, use <code>&lt;cite&gt;</code> with a link:</figcaption>
<pre><code>&lt;p&gt;&lt;cite&gt;&lt;a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)"&gt;Aladdin&lt;/a&gt;&lt;/cite&gt; is a great movie, even after 73 viewings. Aren’t kids great?&lt;/p&gt;</code></pre>
<p><cite><a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)">Aladdin</a></cite> is a great movie, even after 73 viewings. Aren’t kids great?</p>
</figure>

<figure>
<figcaption>Use <code>&lt;cite&gt;</code> for the title of a book (but not the author’s name):</figcaption>
<pre><code>&lt;p&gt;&lt;cite&gt;A Game of Thrones&lt;/cite&gt;, by George R. R. Martin&lt;/p&gt;</code></pre>
<p><cite>A Game of Thrones</cite>, by George R. R. Martin</p>
</figure>

<figure>
<figcaption>If you wanted to semantically indicate the author, you could use <a href="http://html5doctor.com/microformats/" title="Extending HTML5 — Microformats | HTML5 Doctor">microformats</a>, <a href="http://html5doctor.com/microdata" title="Extending HTML5 — Microdata | HTML5 Doctor">microdata</a> or RDFa:</figcaption>
<pre><code>&lt;p&gt;&lt;cite&gt;A Game of Thrones&lt;/cite&gt;, by &lt;span class="hcard"&gt;&lt;span class="fn n"&gt;&lt;span class="given-name"&gt;George&lt;/span&gt; &lt;span class="additional-name"&gt;R. R.&lt;/span&gt; &lt;span class="family-name"&gt;Martin&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</code></pre>
<p><cite>A Game of Thrones</cite>, by <span class="hcard"><span class="fn n"><span class="given-name">George</span> <span class="additional-name">R. R.</span> <span class="family-name">Martin</span></span></span></p>
</figure>

<p>In this example, the author and book title are only connected by proximity. You could connect them more explicitly using <a href="http://microformats.org/wiki/hproduct">the hProduct microformat</a>, <a href="http://wiki.goodrelations-vocabulary.org/Quickstart">RDFa’s GoodRelations</a>, or to really bleed on the edge even <a href="http://schema.org/Book">Schema.org</a>.</p>

<p>Note that you can’t use the now-Google-approved <code>rel="author"</code> attribute here, as <em>George R. R. Martin</em> is being referred to and isn’t writing the article. If you just wanted to style the author’s name, you could use <code>&lt;b class="author"&gt;</code> (gossip column style) or <code>&lt;span class="author"&gt;</code> with whatever CSS you like.</p>

<!-- /#cite-examples --></section>

<!-- /#cite --></section>

<section id="examples">
<h2>All together now <a class="permalink" href="#examples">#</a></h2>

<p>Oay, let’s start mixing things up on the operating table and show some examples of <code>&lt;cite&gt;</code> with <code>&lt;blockquote&gt;</code> and <code>&lt;q&gt;</code>:</p>

<figure>
<figcaption>A movie <code>&lt;blockquote&gt;</code> with <code>&lt;cite&gt;</code>:</figcaption>
<pre><code>&lt;blockquote&gt;
&lt;p&gt;You know the golden rule, don’t you boy? Those who have the gold make the rules.&lt;/p&gt;
&lt;footer&gt;— Crazy hunch-backed old guy in &lt;cite&gt;&lt;a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)"&gt;Aladdin&lt;/a&gt;&lt;/cite&gt;&lt;/footer&gt;
&lt;/blockquote&gt;
</code></pre>
<blockquote>
<p>You know the golden rule, don’t you boy? Those who have the gold make the rules.</p>
<footer>— Crazy hunch-backed old guy in <cite><a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)">Aladdin</a></cite></footer>
</blockquote>
</figure>

<figure>
<figcaption>Adding the <code>cite</code> attribute to a <code>&lt;blockquote&gt;</code> (and its <code>&lt;footer&gt;</code>):</figcaption>
<pre><code>&lt;blockquote cite="http://www.imdb.com/character/ch0000672/quotes"&gt;
&lt;p&gt;You know the golden rule, don’t you boy? Those who have the gold make the rules.&lt;/p&gt;
&lt;footer&gt;— &lt;a href="http://www.imdb.com/character/ch0000672/quotes"&gt;Crazy hunch-backed old guy&lt;/a&gt; in &lt;cite&gt;&lt;a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)"&gt;Aladdin&lt;/a&gt;&lt;/cite&gt;&lt;/footer&gt;
&lt;/blockquote&gt;
</code></pre>
<blockquote cite="http://www.imdb.com/character/ch0000672/quotes">
<p>You know the golden rule, don’t you boy? Those who have the gold make the rules.</p>
<footer>— <a href="http://www.imdb.com/character/ch0000672/quotes">Crazy hunch-backed old guy</a> in <cite><a href="http://en.wikipedia.org/wiki/Aladdin_(1992_Disney_film)">Aladdin</a></cite></footer>
</blockquote>
</figure>

<figure>
<figcaption>A quote from a specification:</figcaption>
<pre><code>&lt;p&gt;I wonder if feedback on &lt;code&gt;&amp;lt;cite&amp;gt;&lt;/code&gt; prompted this:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;A person's name is not the title of a work — even if people call that person a piece of work&lt;/p&gt;
&lt;footer&gt;&lt;cite&gt;&lt;a href="http://developers.whatwg.org/text-level-semantics.html#the-cite-element"&gt;HTML5 for Web Developers&lt;/a&gt;&lt;/cite&gt;&lt;/footer&gt;
&lt;/blockquote&gt;
</code></pre>
<p>I wonder if feedback on <code>&lt;cite&gt;</code> prompted this:</p>
<blockquote><p>A person's name is not the title of a work — even if people call that person a piece of work</p>
<footer>— <cite><a href="http://developers.whatwg.org/text-level-semantics.html#the-cite-element">HTML5 for Web Developers</a></cite></footer>
</blockquote>
</figure>

<figure>
<figcaption>An academic-style journal citation:</figcaption>
<pre><code>&lt;ol&gt;
&lt;li&gt;The information capacity of the human motor system in controlling the amplitude of movement, Paul M. Fitts (1954). &lt;cite&gt;Journal of Experimental Psychology&lt;/cite&gt;, volume 47, number 6, June 1954, pp. 381–391&lt;/li&gt;
&lt;/ol&gt;</code></pre>
<ol>
<li>The information capacity of the human motor system in controlling the amplitude of movement, Paul M. Fitts (1954). <cite>Journal of Experimental Psychology</cite>, volume 47, number 6, June 1954, pp. 381–391</li>
</ol>
</figure>

<figure>
<figcaption>An academic-style book citation:</figcaption>
<pre><code>&lt;blockquote&gt;
&lt;p&gt;Citations … all include the following: author (or editor, compiler, or translator standing in place of the author), title (and usually subtitle), and date of publication.&lt;/p&gt;
&lt;footer&gt;&lt;cite&gt;&lt;a href="http://www.chicagomanualofstyle.org/"&gt;The Chicago Manual of Style&lt;/a&gt;&lt;/cite&gt;, 15th Edition (Chicago: University of Chicago Press, 2003), 596&lt;/footer&gt;
&lt;/blockquote&gt;</code></pre>
<blockquote>
<p>Citations … all include the following: author (or editor, compiler, or translator standing in place of the author), title (and usually subtitle), and date of publication.</p>
<footer>— <cite><a href="http://www.chicagomanualofstyle.org/">The Chicago Manual of Style</a></cite>, 15th Edition (Chicago: University of Chicago Press, 2003), 596</footer>
</blockquote>
</figure>

<!-- /#examples --></section>

<section id="conclusion">
<h2>Conclusion <a class="permalink" href="#conclusion">#</a></h2>

<p>If you’ve made it this far, congratulations! You’ve now learned more about citing and quoting in HTML5 than you wanted to know <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  But don’t keep the knowledge to yourself — let us know in the comments what you think. We’d also love to hear how you’re using <code>&lt;blockquote&gt;</code>, <code>&lt;q&gt;</code>, and <code>&lt;cite&gt;</code> in HTML5. If you share your code snippets, remember to escape them!</p>

<!-- /#conclusion --></section>

<section id="updates">
<h2>Updates <a class="permalink" href="#updates">#</a></h2>
<ol>
<li><strong><time datetime="2011-06-29T17:20:46+09:00">2011-06-29</time></strong>: It seems our long-running convention at HTML5 Doctor of using <code>&lt;footer&gt;</code> for attribution inside a <code>&lt;blockquote&gt;</code> is in keeping with the <code>&lt;footer&gt;</code> part of the spec, but <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=13082" title="Bug 13082">not with the <code>&lt;blockquote&gt;</code> part</a>. We’re investigating…</li>
<li><strong><time datetime="2011-07-03T23:52:47+09:00">2011-07-03</time></strong>: Hixie confirmed that our use of <code>&lt;footer&gt;</code> is currently non-conforming — <code>&lt;footer&gt;</code> can currently only be included in <code>&lt;blockquote&gt;</code> if it’s quoted content. However, the phrase “content inside a blockquote must be quoted from another source” also forbids other <a href="http://oli.jp/example/blockquote-metadata/" title="Examples of block quote metadata ❧ Oli.jp (@boblet)">common changes and additions to block quotes</a>, so I’m going to see if it can be changed.</li>
<li><strong><time datetime="2011-07-10T21:36:58+09:00">2011-07-10</time></strong>: I wrote an article <a href="http://oli.jp/2011/blockquote/" title="Blockquote problems and solutions ❧ Oli.jp (@boblet)"><code>&lt;blockquote&gt;</code> problems and solutions</a> about these problems, and initial feedback from Hixie is that there are legitimate issues, and he’ll review <a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-July/032334.html" title="[whatwg] The blockquote element spec vs common quoting practices">feedback via the WHATWG email list</a>. So, please do that! You can also leave feedback in the comments here or ping me on <a href="http://twitter.com/boblet">Twitter (@boblet)</a>. Also, don’t miss <a href="http://adactio.com/journal/4675/" title="Adactio: Journal&mdash;Citation needed">Jeremy Keith’s excellent commentary “Citation needed”</a> on the issue (watch out for those <code>&lt;cite&gt;</code>s though <img src='http://html5doctor.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</li>
<li><strong><time datetime="2011-09-23T12:55:16+12:00">2011-09-23</time></strong>: I’ve added keyboard shortcuts for punctuation characters to the <a href="#punctuation-characters">punctuation table</a>, for default (typically US) keyboards.</li>
</ol>
<!-- /#updates --></section>


<!-- 
* <q> is only for quotes, not other uses such as sarcasm. use “” or ‘’ instead
  * http://en.wikipedia.org/wiki/Quotation_mark
* don’t add punctuation manually to <q>, one or the other
* use <blockquote> for >1 paragraph of text
 -->
<div id="crp_related"><h3>Related Posts:</h3><ul class="related"><li><a href="http://html5doctor.com/u-element/" rel="bookmark" class="crp_title">The return of the u element</a></li><li><a href="http://html5doctor.com/the-scoped-attribute/" rel="bookmark" class="crp_title">The scoped attribute</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/html5-simplequiz-2-citing-people/" rel="bookmark" class="crp_title">HTML5 Simplequiz #2: citing people</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></ul></div><p><a href="http://html5doctor.com/blockquote-q-cite/" rel="bookmark">Quoting and citing with <code>&lt;blockquote&gt;</code>, <code>&lt;q&gt;</code>, <code>&lt;cite&gt;</code>, and the cite attribute</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on June 28, 2011.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/blockquote-q-cite/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>HTML5 Reset Stylesheet</title>
		<link>http://html5doctor.com/html-5-reset-stylesheet/</link>
		<comments>http://html5doctor.com/html-5-reset-stylesheet/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 14:00:42 +0000</pubDate>
		<dc:creator>Richard Clark</dc:creator>
				<category><![CDATA[Boilerplates]]></category>
		<category><![CDATA[Browser Compatibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[stylesheet]]></category>

		<guid isPermaLink="false">http://html5doctor.com/?p=622</guid>
		<description><![CDATA[We've had a number of people asking about templates, boilerplates and styling for <abbr>HTML</abbr> 5 so to give you all a helping hand and continue on from those basic building blocks that Remy talked about last week I've created a HTML 5 reset stylesheet for you to take away and use, edit, amend and update in your projects.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had a number of people ask about templates, boilerplates, and styling for <abbr>HTML</abbr> 5. Last week, <a href="/author/remys/">Remy</a> introduced some <a href="/html-5-boilerplates/">basic boilerplates for HTML 5</a>, so to keep the momentum going, I&#8217;ve modified <a href="http://meyerweb.com/eric/tools/css/reset/">Eric Meyer&#8217;s <abbr>CSS</abbr> reset</a> for you to use in your HTML 5 projects.</p>

<h2>The code</h2>

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

<pre><code>/* 
html5doctor.com Reset Stylesheet
v1.6.1
Last Updated: 2010-09-17
Author: Richard Clark - http://richclarkdesign.com 
Twitter: @rich_clark
*/

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

body {
    line-height:1;
}

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

nav ul {
    list-style:none;
}

blockquote, q {
    quotes:none;
}

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

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

/* change colours to suit your needs */
ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}

/* change colours to suit your needs */
mark {
    background-color:#ff9;
    color:#000; 
    font-style:italic;
    font-weight:bold;
}

del {
    text-decoration: line-through;
}

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

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

/* change border colour to suit your needs */
hr {
    display:block;
    height:1px;
    border:0;   
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}

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

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

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

<h3>The basics</h3>

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

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

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

<h3>Using attribute selectors</h3>

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

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

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

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

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

<h2>Go grab it</h2>

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

<ul>
<li><a href="http://code.google.com/p/html5resetcss/downloads/list">HTML 5 Reset Stylesheet</a><div id="crp_related"><h3>Related Posts:</h3><ul class="related"><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-contenteditable-attribute/" rel="bookmark" class="crp_title">The contenteditable attribute</a></li><li><a href="http://html5doctor.com/u-element/" rel="bookmark" class="crp_title">The return of the u element</a></li><li><a href="http://html5doctor.com/avoiding-common-html5-mistakes/" rel="bookmark" class="crp_title">Avoiding common HTML5 mistakes</a></li><li><a href="http://html5doctor.com/the-details-and-summary-elements/" rel="bookmark" class="crp_title">The details and summary elements</a></li></ul></div></li>
</ul>
<p><a href="http://html5doctor.com/html-5-reset-stylesheet/" rel="bookmark">HTML5 Reset Stylesheet</a> originally appeared on <a href="http://html5doctor.com">HTML5 Doctor</a> on July 27, 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://html5doctor.com/html-5-reset-stylesheet/feed/</wfw:commentRss>
		<slash:comments>213</slash:comments>
		</item>
	</channel>
</rss>

