<?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>everything flows &#187; hack</title>
	<atom:link href="http://www.lukerodgers.ca/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lukerodgers.ca</link>
	<description>a celestial emporium of benevolent knowledge</description>
	<lastBuildDate>Thu, 29 Jul 2010 17:12:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook uses browser-specific body classes</title>
		<link>http://www.lukerodgers.ca/2009/08/facebook-uses-browser-specific-body-classes/</link>
		<comments>http://www.lukerodgers.ca/2009/08/facebook-uses-browser-specific-body-classes/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 04:00:53 +0000</pubDate>
		<dc:creator>Luke Rodgers</dc:creator>
				<category><![CDATA[web and tech]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.lukerodgers.ca/?p=607</guid>
		<description><![CDATA[Use browser-specific body classes to avoid extra stylesheets or invalid CSS]]></description>
			<content:encoded><![CDATA[<p>Having recently worked on a website for which page load and performance was really important, I&#8217;ve found myself viewing the source code for more and more sites. Taking a look at Facebook recently revealed that they use browser-specific classes on the body element, so that if you&#8217;re browsing with Safari 4, you&#8217;ll see something like:<span id="more-607"></span></p>
<p><code class="block">&lt;body class="home safari4 Locale_en_GB chat_body"&gt;</code></p>
<p>If you&#8217;re already browser sniffing, this might be a better idea for applying targeted <abbr title="Cascading Style Sheets">CSS</abbr> rules than including an extra stylesheet with conditional comments (which means an extra <abbr title="HyperText Transfer Protocol">HTTP</abbr> request), or using the underscore hack (<abbr title="Internet Explorer 6">IE6</abbr>), or star hack (IE7) which cause invalid <abbr title="Cascading Style Sheets">CSS</abbr>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.lukerodgers.ca/2009/08/facebook-uses-browser-specific-body-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 CSS hacks with Wordpress.com</title>
		<link>http://www.lukerodgers.ca/2009/02/ie6-css-hacks-with-wordpresscom/</link>
		<comments>http://www.lukerodgers.ca/2009/02/ie6-css-hacks-with-wordpresscom/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 03:08:45 +0000</pubDate>
		<dc:creator>Luke Rodgers</dc:creator>
				<category><![CDATA[annoying things]]></category>
		<category><![CDATA[web and tech]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://www.lukerodgers.ca/?p=474</guid>
		<description><![CDATA[A trick for tweaking the CSS of your Wordpress.com blog for IE6.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a Wordpress.com blog for someone for which the &#8220;edit the <abbr title="Cascading Style Sheets">CSS</abbr>&#8221; upgrade has been purchased, and all has gone swell so far with tweaking the Kubrick theme. A couple <code>!important</code> declarations needed, but no big deal. That is, of course, until &#8220;make it work in <abbr title="Internet Explorer 6">IE6</abbr>&#8243; time came along.</p>
<p><span id="more-474"></span>Normally I&#8217;d just include a conditional comment, something seen by most developers to be a best practice, but in this case we can&#8217;t modify the php template files, so I had to break out the <abbr title="Cascading Style Sheets">CSS</abbr> hacks that I thought I had said goodbye to a few years ago.</p>
<p>There are several ways to go about this. First, I tried <a href="http://www.ejeliot.com/blog/63">these tips from Ed Eliot</a>, using the underscore trick to target just <abbr title="Internet Explorer 6">IE6</abbr>. But interestingly (and perhaps unsurprisingly) Wordpress.com apparently won&#8217;t let you save any code that isn&#8217;t valid. I had it confirmed by support that my <code>_margin-top: -200px;</code> wouldn&#8217;t work.</p>
<p>After briefly considering @importing another stylesheet, I instead went with the <abbr title="Cascading Style Sheets 2">CSS2</abbr> child selector approach outlined in a <a href="http://24ways.org/2005/avoiding-css-hacks-for-internet-explorer">24ways article from 2005</a>. Basically, since <abbr title="Internet Explorer 6">IE6</abbr> doesn&#8217;t support the child selector &#8216;&gt;&#8217;, you can make one declaration for <abbr title="Internet Explorer 6">IE6</abbr> then another for more advanced browsers using the child selector. E.g.<br />
<code class="block"> </code></p>
<pre>#content { /* for <abbr title="Internet Explorer 6">IE6</abbr> */
   margin-top: -200px;
}
#page &gt; #content { /* for other browsers, incl. IE7+ */
   margin-top: 40px;
}</pre>
<p>This might not get you all the mileage you need, but will probably help.</p>]]></content:encoded>
			<wfw:commentRss>http://www.lukerodgers.ca/2009/02/ie6-css-hacks-with-wordpresscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
