<?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>Ian Dunn &#187; CSS</title>
	<atom:link href="http://iandunn.name/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://iandunn.name</link>
	<description>Seattle-based web developer blogging about tips and solutions</description>
	<lastBuildDate>Fri, 18 May 2012 18:11:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>My First Shot at Adaptive Images</title>
		<link>http://iandunn.name/my-first-shot-at-adaptive-images/</link>
		<comments>http://iandunn.name/my-first-shot-at-adaptive-images/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 01:30:56 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML / XHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Standards and Best Practices]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[max-width]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Responsive Web Design]]></category>

		<guid isPermaLink="false">http://iandunn.name/?p=1003</guid>
		<description><![CDATA[One of the first problems you run into when trying to build an <a title="Responsive Web Design" href="http://alistapart.com/articles/responsive-web-design/">adaptive layout</a> is that images, unlike blocks of text, have fixed widths. Ideally we want to use small images on small screens and full sized ones on larger screens. The browser can resize the image on the fly, but the two problems with this... [<a href="http://iandunn.name/my-first-shot-at-adaptive-images/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>One of the first problems you run into when trying to build an <a title="Responsive Web Design" href="http://alistapart.com/articles/responsive-web-design/">adaptive layout</a> is that images, unlike blocks of text, have fixed widths. Ideally we want to use small images on small screens and full sized ones on larger screens. The browser can resize the image on the fly, but the two problems with this are: 1) on Windows systems, the  quality degrades when the browser scales the image; and 2) Mobile users shouldn&#8217;t have to download a large image, only to scale it down. That takes much more time and bandwidth than necessary.</p>
<p>There are half a dozen popular solutions to this, but I wasn&#8217;t completely happy with any of them on their own, so I&#8217;m experimenting with using a combination of  <a title="Fluid Images" href="http://unstoppablerobotninja.com/entry/fluid-images/">Ethan Marcotte&#8217;s max-width technique</a> and a modified version of <a title="Responsive images using cookies" href="http://blog.keithclark.co.uk/responsive-images-using-cookies">Keith Clark&#8217;s cookie technique</a>. The cookie technique can be used to determine the size of a user&#8217;s screen before outputting the filename, so you can serve a low-res version to mobile devices and a high-res version to desktops. You can add the max-width technique on top of that to handle any situations where the image still doesn&#8217;t fit right.</p>
<p>My modification to Keith&#8217;s technique is that instead of setting the image&#8217;s src tag to call a PHP file which outputs the respective image&#8217;s contents, I just have the function determine the path of the appropriate image. That avoids the faux URL and any caching issues. The image quality will still degrade when it has to scale, but serving multiple images minimizes the number of times that occurs. The major downside is that the it only takes effect after the first page load. But, given the lack of a proper solution, I think that&#8217;s an acceptable compromise.</p>
<p><strong>Update: </strong>I&#8217;m now also considering adding a third layer to help minimize the cases where the first load would include the large images. The browser doesn&#8217;t send the screen width with the HTTP request, but it does send a user agent string. The code could parse out the agent and default to the small images for known mobile browsers. On it&#8217;s own user agent detection is insufficient, but it may be useful as one of many layers. There could be issues with unreliable (or intentionally false) agent disclosures, and also with different devices using the same agent even though they have different screen capabilities, so it&#8217;ll have to be tested out thoroughly, but I think it&#8217;s worth a shot.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/my-first-shot-at-adaptive-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Primer on Responsive Web Design</title>
		<link>http://iandunn.name/a-primer-on-responsive-web-design/</link>
		<comments>http://iandunn.name/a-primer-on-responsive-web-design/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 16:27:19 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML / XHTML]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Responsive Web Design]]></category>

		<guid isPermaLink="false">http://iandunn.name/?p=962</guid>
		<description><![CDATA[Ben Callahan from <a href="http://seesparkbox.com/">Sparkbox</a> shared some good links on responsive web design recently, one of them being <a title="An introduction to responsive web design" href="http://www.alistapart.com/articles/responsive-web-design/">this introduction</a> to the subject from A List Apart. One of the things that struck me from the article was that &#8220;[mobile] browsing is expected to outpace desktop-based access within three to five years.&#8221; Another link to Smashing Magazine was a reference of... [<a href="http://iandunn.name/a-primer-on-responsive-web-design/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>Ben Callahan from <a href="http://seesparkbox.com/">Sparkbox</a> shared some good links on responsive web design recently, one of them being <a title="An introduction to responsive web design" href="http://www.alistapart.com/articles/responsive-web-design/">this introduction</a> to the subject from A List Apart. One of the things that struck me from the article was that &#8220;[mobile] browsing is expected to outpace desktop-based access within three to five years.&#8221;</p>
<p>Another link to Smashing Magazine was a reference of <a title="Responsive Web Design Techniques, Tools and Design Strategies" href="http://www.smashingmagazine.com/2011/07/22/responsive-web-design-techniques-tools-and-design-strategies/">tools and techniques</a>, and a third was a <a href="http://mediaqueri.es/">collection of sites using media queries</a> to adapt the layout to various devices. I&#8217;m hoping that device <a title="Mobile Emulators" href="http://mobiforge.com/emulators/page/mobile-emulators">emulators</a> will become more readily available and reliable so that <a href="http://www.alistapart.com/articles/smartphone-browser-landscape/">testing</a> won&#8217;t be such a frustrating ordeal. Frameworks like <a href="http://stuffandnonsense.co.uk/projects/320andup/">320 and Up</a> can help get off to a good start.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/a-primer-on-responsive-web-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W3Schools Isn&#8217;t Official or Accurate</title>
		<link>http://iandunn.name/w3schools-isnt-official-or-accurate/</link>
		<comments>http://iandunn.name/w3schools-isnt-official-or-accurate/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 16:00:02 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Ethics and Values]]></category>
		<category><![CDATA[HTML / XHTML]]></category>
		<category><![CDATA[Divya Manian]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[W3Fools]]></category>
		<category><![CDATA[W3Schools]]></category>
		<category><![CDATA[WordCamp Seattle]]></category>

		<guid isPermaLink="false">http://iandunn.name/?p=725</guid>
		<description><![CDATA[<a href="http://nimbupani.com/">Divya Manian</a> gave a presentation yesterday at <a href="http://wordcampseattle.org/">WordCamp Seattle</a> about generating proper markup when creating output from plugins, and she mentioned a site called <a href="http://w3fools.com/">W3Fools.com</a> , which is basically a protest against <a rel="nofollow" href="http://w3schools.com">W3Schools.com</a> . I didn&#8217;t realize until I saw W3Fools, but W3Schools isn&#8217;t actually ran by the W3C, and it contains a lot of inaccurate information. Further, it seems like... [<a href="http://iandunn.name/w3schools-isnt-official-or-accurate/">more</a>]]]></description>
			<content:encoded><![CDATA[<p><a href="http://nimbupani.com/">Divya Manian</a> gave a presentation yesterday at <a href="http://wordcampseattle.org/">WordCamp Seattle</a> about generating proper markup when creating output from plugins, and she mentioned a site called <a href="http://w3fools.com/">W3Fools.com</a>, which is basically a protest against <a rel="nofollow" href="http://w3schools.com">W3Schools.com</a>. I didn&#8217;t realize until I saw W3Fools, but W3Schools isn&#8217;t actually ran by the W3C, and it contains a lot of inaccurate information. Further, it seems like they intentionally try to mislead people into thinking they&#8217;re an official source of documentation so they can sell their &#8220;certifications,&#8221; which have little to no actual weight in the real world.</p>
<p>They list several alternatives, but I like <a title="SitePoint HTML/CSS/JavaScript Reference" href="http://reference.sitepoint.com">SitePoint&#8217;s</a> the best, so I&#8217;m going to start using it in the future instead of W3Schools.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/w3schools-isnt-official-or-accurate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Body Classes Instead of Conditional Stylesheets</title>
		<link>http://iandunn.name/body-classes-instead-of-conditional-stylesheets/</link>
		<comments>http://iandunn.name/body-classes-instead-of-conditional-stylesheets/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 19:31:29 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML / XHTML]]></category>
		<category><![CDATA[Standards and Best Practices]]></category>
		<category><![CDATA[Conditional Stylesheets]]></category>
		<category><![CDATA[CSS Hacks]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=506</guid>
		<description><![CDATA[I&#8217;m thinking I should create a, &#8216;Duh, why didn&#8217;t I think of that?&#8217; category for this. Instead of using conditional stylesheets or CSS hacks to fix Internet Explorer&#8217;s obnoxious lack of support for standards, you can  <a title="'Conditional stylesheets vs CSS hacks? Answer: Neither!' by Paul Irish" href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/">conditionally set a class on the html or body tag</a> and target that in your normal stylesheet. This is better for several reasons, including faster page load times and... [<a href="http://iandunn.name/body-classes-instead-of-conditional-stylesheets/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m thinking I should create a, &#8216;Duh, why didn&#8217;t I think of that?&#8217; category for this. Instead of using conditional stylesheets or CSS hacks to fix Internet Explorer&#8217;s obnoxious lack of support for standards, you can <a title="'Conditional stylesheets vs CSS hacks? Answer: Neither!' by Paul Irish" href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/">conditionally set a class on the <em>html</em> or <em>body</em> tag</a> and target that in your normal stylesheet. This is better for several reasons, including faster page load times and better organization/maintainability.</p>
<p>Of course, as Louis Lazaris <a title="'Don’t Use Conditional Comments to Create Classes for IE7+' by Louis Lazaris" href="http://www.impressivewebs.com/conditional-comments-classes-ie/">points out</a>, it&#8217;s even better if you just massage your regular styles a bit to make them work in all the modern browsers &#8212; which, in my experience, usually isn&#8217;t too hateful.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/body-classes-instead-of-conditional-stylesheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Light and Clean CSS Message Box Styles</title>
		<link>http://iandunn.name/light-and-clean-css-message-box-styles/</link>
		<comments>http://iandunn.name/light-and-clean-css-message-box-styles/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 19:17:49 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=504</guid>
		<description><![CDATA[Here are a couple examples of good colors to use for clean CSS message boxes: <a href="http://www.mattvarone.com/web-design/message-box-with-css/">http://www.mattvarone.com/web-design/message-box-with-css/</a> <a href="http://www.ajaxlines.com/ajax/stuff/article/css_message_box_collection.php">http://www.ajaxlines.com/ajax/stuff/article/css_message_box_collection.php</a>]]></description>
			<content:encoded><![CDATA[<p>Here are a couple examples of good colors to use for clean CSS message boxes:</p>
<ul>
<li><a href="http://www.mattvarone.com/web-design/message-box-with-css/">http://www.mattvarone.com/web-design/message-box-with-css/</a></li>
<li><a href="http://www.ajaxlines.com/ajax/stuff/article/css_message_box_collection.php">http://www.ajaxlines.com/ajax/stuff/article/css_message_box_collection.php</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/light-and-clean-css-message-box-styles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sub-pixel letter-spacing in CSS</title>
		<link>http://iandunn.name/sub-pixel-letter-spacing-in-css/</link>
		<comments>http://iandunn.name/sub-pixel-letter-spacing-in-css/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 22:20:39 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[letter-spacing]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=356</guid>
		<description><![CDATA[There&#8217;s a thread on the Sitepoint forums about <a href="http://www.sitepoint.com/forums/showthread.php?t=607166">the smallest amount of letter-spacing you can use</a> . Most of the responses are useless, annoying and wrong, but #36 finally gives a good answer. Most browsers only support integer pixel values for letter-spacing. This is a problem because, when it comes to letter-spacing, there&#8217;s a big difference between 0 and 1px. Ems and other relative... [<a href="http://iandunn.name/sub-pixel-letter-spacing-in-css/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a thread on the Sitepoint forums about <a href="http://www.sitepoint.com/forums/showthread.php?t=607166">the smallest amount of letter-spacing you can use</a>. Most of the responses are useless, annoying and wrong, but #36 finally gives a good answer.</p>
<p>Most browsers only support integer pixel values for letter-spacing. This is a problem because, when it comes to letter-spacing, there&#8217;s a big difference between 0 and 1px. Ems and other relative units are converted to pixels before rendering, so they won&#8217;t work either. It looks like Firefox is the only browser that currently supports sub-pixel rendering.</p>
<p>So, you can use something like .5px for Firefox, but other browsers will round to an integer.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/sub-pixel-letter-spacing-in-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Distributing Fonts Via @font-face</title>
		<link>http://iandunn.name/distributing-fonts-via-font-face/</link>
		<comments>http://iandunn.name/distributing-fonts-via-font-face/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 19:39:46 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[Fonts]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=349</guid>
		<description><![CDATA[Instead of using images, Flash or JavaScript to replace normal text with non-standard fonts, you can now use CSS&#8217;s <a href="http://sixrevisions.com/css/font-face-guide/">@font-face rule</a> . It will tell the browser to download the fonts and render the text using them. Internet Explorer uses the EOT format and everyone else uses TrueType, so you need to <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">declare the sources in a specific order to make it work across browsers</a> . You can get compress... [<a href="http://iandunn.name/distributing-fonts-via-font-face/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>Instead of using images, Flash or JavaScript to replace normal text with non-standard fonts, you can now use CSS&#8217;s <a href="http://sixrevisions.com/css/font-face-guide/">@font-face rule</a>. It will tell the browser to download the fonts and render the text using them. Internet Explorer uses the EOT format and everyone else uses TrueType, so you need to <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">declare the sources in a specific order to make it work across browsers</a>.</p>
<pre class="brush: css; title: ; notranslate">
@font-face
{
  font-family: 'Angelina';
  src: url('lib/fonts/angelina.eot');
  src: local('Angelina'),
  url('lib/fonts/angelina.ttf') format('truetype');
}
</pre>
<p>You can get compress and convert a font to TTF and EOT versions with Font Squirrel&#8217;s <a href="http://www.fontsquirrel.com/fontface/generator">generator</a>.</p>
<p>Because they&#8217;re being distributed, though, they need to be licensed for that. A couple good places to get freely distributable fonts are <a href="http://www.theleagueofmoveabletype.com/">The League of Movable Type</a>, <a href="http://www.fontsquirrel.com/">Font Squirrel</a> and <a href="http://www.dafont.com/">dafont.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/distributing-fonts-via-font-face/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Z-Index Stacking Contexts</title>
		<link>http://iandunn.name/z-index-stacking-contexts/</link>
		<comments>http://iandunn.name/z-index-stacking-contexts/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 17:36:36 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Paolo Lombardi]]></category>
		<category><![CDATA[Stacking Context]]></category>
		<category><![CDATA[z-index]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=306</guid>
		<description><![CDATA[One important thing to keep in mind while working with <a href="http://reference.sitepoint.com/css/z-index">z-index</a> is that multiple stacking orders are created based on the markup hierarchy. This means that an element with a z-index of 30 can actually appear below an element with a z-index of 20, if the z-index of the original element&#8217;s parent is 10. Paolo Lombardi... [<a href="http://iandunn.name/z-index-stacking-contexts/">more</a>]]]></description>
			<content:encoded><![CDATA[<p>One important thing to keep in mind while working with <a href="http://reference.sitepoint.com/css/z-index">z-index</a> is that multiple stacking orders are created based on the markup hierarchy. This means that an element with a z-index of 30 can actually appear <em>below</em> an element with a z-index of 20, if the z-index of the original element&#8217;s <em>parent</em> is 10.</p>
<p>Paolo Lombardi explains this well in his article on <a href="https://developer.mozilla.org/en/Understanding_CSS_z-index/The_stacking_context">stacking context</a>, and includes this helpful diagram:</p>
<p><a href="https://developer.mozilla.org/en/Understanding_CSS_z-index/The_stacking_context"><img class="alignnone" src="https://developer.mozilla.org/@api/deki/files/913/=Understanding_zindex_04.png" alt="Example of multiple=" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/z-index-stacking-contexts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Selector Browser Compatbility</title>
		<link>http://iandunn.name/css-selector-browser-compatbility/</link>
		<comments>http://iandunn.name/css-selector-browser-compatbility/#comments</comments>
		<pubDate>Mon, 17 May 2010 18:30:20 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=295</guid>
		<description><![CDATA[kimblim.dk has a <a href="http://kimblim.dk/css-tests/selectors/">chart showing browser support for various CSS selectors</a> , including pseudo selectors. It includes CSS versions 1 through 3 and all of the major browser versions.]]></description>
			<content:encoded><![CDATA[<p>kimblim.dk has a <a href="http://kimblim.dk/css-tests/selectors/">chart showing browser support for various CSS selectors</a>, including pseudo selectors. It includes CSS versions 1 through 3 and all of the major browser versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/css-selector-browser-compatbility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Above Anchors Disappear</title>
		<link>http://iandunn.name/content-above-anchors-disappear/</link>
		<comments>http://iandunn.name/content-above-anchors-disappear/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 17:22:16 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML / XHTML]]></category>
		<category><![CDATA[Equal Height Columns]]></category>

		<guid isPermaLink="false">http://iandunn.name/workblog/?p=257</guid>
		<description><![CDATA[It turns out there&#8217;s a serous problem with <a href="http://www.positioniseverything.net/articles/onetruelayout/equalheight">the One True Layout method of creating equal height columns</a> . All of <a href="http://www.positioniseverything.net/articles/onetruelayout/appendix/equalheightproblems#linking">the content above an anchor will be shifted up</a> , making it seem like it disappeared. There aren&#8217;t any universal or reliable fixes for this, so the <a href="http://www.alistapart.com/articles/fauxcolumns/">Faux Columns</a> method is probably the best choice if it&#8217;ll fit the design. <a href="http://www.positioniseverything.net/articles/onetruelayout/equalheight"></a>]]></description>
			<content:encoded><![CDATA[<p>It turns out there&#8217;s a serous problem with <a href="http://www.positioniseverything.net/articles/onetruelayout/equalheight">the One True Layout method of creating equal height columns</a>. All of <a href="http://www.positioniseverything.net/articles/onetruelayout/appendix/equalheightproblems#linking">the content above an anchor will be shifted up</a>, making it seem like it disappeared. There aren&#8217;t any universal or reliable fixes for this, so the <a href="http://www.alistapart.com/articles/fauxcolumns/">Faux Columns</a> method is probably the best choice if it&#8217;ll fit the design.</p>
<p><a href="http://www.positioniseverything.net/articles/onetruelayout/equalheight"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://iandunn.name/content-above-anchors-disappear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

