<?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>Skull Jackpot &#187; improvement</title>
	<atom:link href="http://skulljackpot.com/tagged-as/improvement/feed/" rel="self" type="application/rss+xml" />
	<link>http://skulljackpot.com</link>
	<description>Various thoughts of minimal interest to others</description>
	<lastBuildDate>Fri, 25 Feb 2011 16:22:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Better Blockquotes</title>
		<link>http://skulljackpot.com/2008/09/26/better-blockquotes/</link>
		<comments>http://skulljackpot.com/2008/09/26/better-blockquotes/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 21:34:01 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Under the hood]]></category>
		<category><![CDATA[blockquotes]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[improvement]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://skulljackpot.com/?p=5</guid>
		<description><![CDATA[<p>For the <a href="http://streetsblog.org">Streetsblog</a> WordPress theme, we wanted to include a widget which would display a featured user comment. The comp had spiffy oversized quotes surrounding the featured text.</p>

<p>I'd seen <a href="http://24ways.org/2005/swooshy-curly-quotes-without-images">http://24ways.org/2005/swooshy-curly-quotes-without-images</a> a while back, and decided to improve upon it for the new Streetsblog site. In particular, the floated close quotes in Simon Willison's approach will often leave a lot of whitespace.</p>]]></description>
			<content:encoded><![CDATA[<p>For the <a href="http://streetsblog.org">Streetsblog</a> WordPress theme, we wanted to include a widget which would display a featured user comment. The comp had spiffy oversized quotes surrounding the featured text.</p>
<p>I&#8217;d seen <a href="http://24ways.org/2005/swooshy-curly-quotes-without-images">http://24ways.org/2005/swooshy-curly-quotes-without-images</a> a while back, and decided to improve upon it for the new Streetsblog site. In particular, the floated close quotes in Simon Willison&#8217;s approach will often leave a lot of whitespace.</p>
<div><a href="http://skitch.com/dimmerswitch/abbp/firefox-blockquotes-start"><img src="http://img.skitch.com/20081001-1yb7a73s1wtrkaa33dut89p8be.preview.jpg" alt="firefox-blockquotes-start"></a></div>
<p>The first version I&#8217;d done looked fine, and is what we launched with, but after a while folks found an odd renderbug. Internet Explorer (versions 6 and 7) would drop the quoted text down by about 2em, but <strong>only if the quote fit on a single line</strong>.</p>
<p>This week I was able to track down and fix the issue.</p>
<p>Here&#8217;s a screenshot of our launch CSS, as rendered by standards-compliant browsers:</p>
<div><a href="http://skitch.com/dimmerswitch/abbi/firefox-launch-css"><img src="http://img.skitch.com/20081001-tfjhrx5778361a788ftiikqhuu.preview.jpg" alt="firefox-launch-css"></a></div>
<p>Here&#8217;s a screenshot of our launch CSS, as rendered by Internet Explorer:</p>
<div><a href="http://skitch.com/dimmerswitch/abb5/ie7-blockquote-launch-css"><img src="http://img.skitch.com/20081001-kx2p6p6j3mt7d6tndh7c9c6iei.preview.jpg" alt="ie7-blockquote-launch-css"></a></div>
<p>After a little digging, it became clear that the issue was IE inappropriately using the line-height for the opening quote for the <em>entire</em> blockquote, in those cases where the blockquote fits on a single line.</p>
<p>Lots of tinkering with <code>line-height</code> and <code>vertical-align</code> properties ensued &#8211; those have got to be the least consistent CSS properties I&#8217;ve run into for a while, and will probably be the subject of a later post.</p>
<p>Eventually, I ended up with something that worked in standards-compliant browsers:</p>
<div><a href="http://skitch.com/dimmerswitch/abc5/firefox-better-blockquotes"><img src="http://img.skitch.com/20081001-crdh9pthbjbqpgdyyngfxtfcfe.preview.jpg" alt="firefox-better-blockquotes"></a></div>
<p>And looks fine in IE7:</p>
<div><a href="http://skitch.com/dimmerswitch/abnx/ie7-better-blockquotes"><img src="http://img.skitch.com/20081001-g7ajh8tmh1u2a85t2ehf89jy9f.preview.jpg" alt="ie7-better-blockquotes"></a></div>
<p>IE6 has an issue with line-height still &#8211; it will incorrectly indent the second line of text, to make room for the floated open quote (because IE6 ignores our explicit height declaration for that element):</p>
<div><a href="http://skitch.com/dimmerswitch/abna/ie6-betterblockquotes"><img src="http://img.skitch.com/20081001-f9reea1imk2hbg3n78equdyb8y.preview.jpg" alt="ie6-betterblockquotes"></a></div>
<p>That&#8217;s a tradeoff I&#8217;m willing to accept, in this case.</p>
<h2>Markup for Better Blockquotes</h2>
<p><code>&lt;blockquote class="selfclear"&gt;<br />
	&lt;span class="open-quote"&gt;<span>&#038;</span>#8220;&lt;/span&gt;<br />
	Fiction is obliged to stick to possibilities. Truth isn't.<br />
	&lt;span class="close-quote"&gt;<span>&#038;</span>#8221;&lt;/span&gt;<br />
&lt;/blockquote&gt;</code></p>
<p><strong>Note</strong>: The selfclear class is a variation of the clever method <a href="http://www.positioniseverything.net/easyclearing.html">originally written up</a> at Position Is Everything &#8211; used to clear floats without unnecessary markup.</p>
<h2>CSS for Better Blockquotes</h2>
<p><code>.selfclear:after {<br />
content: ".";<br />
display: block;<br />
height: 0;<br />
clear: both;<br />
visibility: hidden;<br />
}</code></p>
<p><code>.selfclear {<br />
display: inline-block; /* IE 7 */<br />
}</code></p>
<p><code>.selfclear {<br />
display: block;<br />
}</code></p>
<p><code>* html .selfclear {<br />
height: 1px; /* IE &lt; 7 */<br />
}</code></p>
<p><code>blockquote {<br />
font-style: italic;<br />
color: #191f2f;<br />
font-size: 1.3em;<br />
line-height: 2em;<br />
}</code></p>
<p><code>blockquote .open-quote, <br />
blockquote .close-quote {<br />
font-family: georgia, serif;<br />
color: #6b707e;<br />
font-style: normal;<br />
font-size: 4em;<br />
line-height: 1em;<br />
}</code></p>
<p><code>blockquote .open-quote {<br />
float: left;<br />
height: 0.35em;<br />
padding: 0 0.1em 0 0;<br />
vertical-align: -60%;<br />
position: relative;<br />
top: -0.1em;<br />
}</code></p>
<p><code>blockquote .close-quote {<br />
vertical-align: -50%;<br />
padding: 0 0 0 0.1em;<br />
}</code></p>
<p>Replace the fonts and colors as needed for your design, and you should be all set!</p>
]]></content:encoded>
			<wfw:commentRss>http://skulljackpot.com/2008/09/26/better-blockquotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.277 seconds -->

