<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: CSS Browser Hacks</title>
	<atom:link href="http://ajaxian.com/archives/css-browser-hacks/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/css-browser-hacks</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: PaulIrish</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-274864</link>
		<dc:creator>PaulIrish</dc:creator>
		<pubDate>Mon, 03 Aug 2009 16:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-274864</guid>
		<description>I have updated my list with compatibility for new browsers (saf4, chrome2, ie8) as well as added some new ones:

http://paulirish.com/2009/browser-specific-css-hacks/</description>
		<content:encoded><![CDATA[<p>I have updated my list with compatibility for new browsers (saf4, chrome2, ie8) as well as added some new ones:</p>
<p><a href="http://paulirish.com/2009/browser-specific-css-hacks/" rel="nofollow">http://paulirish.com/2009/browser-specific-css-hacks/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mathiasbaert</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273121</link>
		<dc:creator>mathiasbaert</dc:creator>
		<pubDate>Mon, 27 Apr 2009 16:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273121</guid>
		<description>should have been

div.stuff {
general:rules;
}
body.ie div.stuff {
specific:exception;
}

of course</description>
		<content:encoded><![CDATA[<p>should have been</p>
<p>div.stuff {<br />
general:rules;<br />
}<br />
body.ie div.stuff {<br />
specific:exception;<br />
}</p>
<p>of course</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mathiasbaert</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273120</link>
		<dc:creator>mathiasbaert</dc:creator>
		<pubDate>Mon, 27 Apr 2009 16:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273120</guid>
		<description>Pro-tip: don&#039;t use hacks.

When I really need to add something for legacy browsers I add the browsername and browername+majorversion serverside.

1. It makes stylesheets much better readable. When I see a syntax error in a stylesheet I don&#039;t like guessing what browser this piece of line noise is targetting and whether it was intentional at all.
2. The general styles and the exceptions are together in the same file at the same location: better readability than including another file with only the exceptions via conditional comments.
3. Adding it clientside with js (the dojo solution as suggested above) displays the wrong style until the page has loaded, asuming you&#039;re waiting for onload or documentready.
4. Doesn&#039;t break when the next browser comes out.
5. Browsers that lie in their browserstring get what they ask for, not my problem.

example



div.stuff {
    general:rules;
}
body.ie {
    specific:exception;
}

Please let the hacks just die.
I don&#039;t remember where I picked up this technique but while still not perfect it&#039;s the most elegant solution I&#039;ve seen.</description>
		<content:encoded><![CDATA[<p>Pro-tip: don&#8217;t use hacks.</p>
<p>When I really need to add something for legacy browsers I add the browsername and browername+majorversion serverside.</p>
<p>1. It makes stylesheets much better readable. When I see a syntax error in a stylesheet I don&#8217;t like guessing what browser this piece of line noise is targetting and whether it was intentional at all.<br />
2. The general styles and the exceptions are together in the same file at the same location: better readability than including another file with only the exceptions via conditional comments.<br />
3. Adding it clientside with js (the dojo solution as suggested above) displays the wrong style until the page has loaded, asuming you&#8217;re waiting for onload or documentready.<br />
4. Doesn&#8217;t break when the next browser comes out.<br />
5. Browsers that lie in their browserstring get what they ask for, not my problem.</p>
<p>example</p>
<p>div.stuff {<br />
    general:rules;<br />
}<br />
body.ie {<br />
    specific:exception;<br />
}</p>
<p>Please let the hacks just die.<br />
I don&#8217;t remember where I picked up this technique but while still not perfect it&#8217;s the most elegant solution I&#8217;ve seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remi</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273106</link>
		<dc:creator>Remi</dc:creator>
		<pubDate>Mon, 27 Apr 2009 11:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273106</guid>
		<description>@AnM8tR  : Just a very quick note on client-side performances : if you include your JS file just after your stylesheet, your browser (whatever it is) won&#039;t be able to parallelize tasks. I&#039;ve done a few tests and, depending on the browser, I have been able to save between 1% (FF3) and 40% (Chrome) on page rendering with a very good 20% on IE7. Important note : my CSS is pretty huge but is served everywhere on my site :)

So, if your JS don&#039;t rely on your CSS (in your case, it seems it does), do not hesitate to swap their position and insert JS before CSS :)</description>
		<content:encoded><![CDATA[<p>@AnM8tR  : Just a very quick note on client-side performances : if you include your JS file just after your stylesheet, your browser (whatever it is) won&#8217;t be able to parallelize tasks. I&#8217;ve done a few tests and, depending on the browser, I have been able to save between 1% (FF3) and 40% (Chrome) on page rendering with a very good 20% on IE7. Important note : my CSS is pretty huge but is served everywhere on my site :)</p>
<p>So, if your JS don&#8217;t rely on your CSS (in your case, it seems it does), do not hesitate to swap their position and insert JS before CSS :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AnM8tR</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273102</link>
		<dc:creator>AnM8tR</dc:creator>
		<pubDate>Sun, 26 Apr 2009 16:45:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273102</guid>
		<description>@csuwldcat:
I&#039;m not sure that was clear. Here&#039;s what happens:
document loads.
html tag loads
css loads (if the were included first)
scripts load (typically dojo.js first)
dojo sniffs the browser
dojo inserts special dj_ie (etc) classes in the html tag
dojo parses widgets
onDomContent loads (page displays)
css styles are applied (by CSS, not dojo)

The targets work just like any other CSS. 
.myDiv{display:block;}
.dj_ie .myDiv{display:none;}

I should note its actually Dijit doing this, not Dojo Base. I&#039;d like to see it moved to Dojo Base though.

The designers on our staff love this feature. It works great.</description>
		<content:encoded><![CDATA[<p>@csuwldcat:<br />
I&#8217;m not sure that was clear. Here&#8217;s what happens:<br />
document loads.<br />
html tag loads<br />
css loads (if the were included first)<br />
scripts load (typically dojo.js first)<br />
dojo sniffs the browser<br />
dojo inserts special dj_ie (etc) classes in the html tag<br />
dojo parses widgets<br />
onDomContent loads (page displays)<br />
css styles are applied (by CSS, not dojo)</p>
<p>The targets work just like any other CSS.<br />
.myDiv{display:block;}<br />
.dj_ie .myDiv{display:none;}</p>
<p>I should note its actually Dijit doing this, not Dojo Base. I&#8217;d like to see it moved to Dojo Base though.</p>
<p>The designers on our staff love this feature. It works great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AnM8tR</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273101</link>
		<dc:creator>AnM8tR</dc:creator>
		<pubDate>Sun, 26 Apr 2009 16:37:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273101</guid>
		<description>@csuwldcat:
The classes are inserted before the dom loads (but after the html tag and body tag load). If the page &quot;snapped&quot; it wouldn&#039;t be acceptable.</description>
		<content:encoded><![CDATA[<p>@csuwldcat:<br />
The classes are inserted before the dom loads (but after the html tag and body tag load). If the page &#8220;snapped&#8221; it wouldn&#8217;t be acceptable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csuwldcat</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273096</link>
		<dc:creator>csuwldcat</dc:creator>
		<pubDate>Sun, 26 Apr 2009 02:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273096</guid>
		<description>just putting a asterisk in front of the property alone is an IE7 only targeted hack, no need for all that first-child+html stuff...</description>
		<content:encoded><![CDATA[<p>just putting a asterisk in front of the property alone is an IE7 only targeted hack, no need for all that first-child+html stuff&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: naterkane</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273093</link>
		<dc:creator>naterkane</dc:creator>
		<pubDate>Sat, 25 Apr 2009 15:45:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273093</guid>
		<description>IIRC *:first-child+html is IE7 only.</description>
		<content:encoded><![CDATA[<p>IIRC *:first-child+html is IE7 only.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vsync</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273091</link>
		<dc:creator>vsync</dc:creator>
		<pubDate>Sat, 25 Apr 2009 09:45:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273091</guid>
		<description>Well, some of these are hacks which will not be validated..like the underscore hack.. for the past 3 years I have been using this wonderful website: http://www.webdevout.net/css-hacks

very helpful back in the days..</description>
		<content:encoded><![CDATA[<p>Well, some of these are hacks which will not be validated..like the underscore hack.. for the past 3 years I have been using this wonderful website: <a href="http://www.webdevout.net/css-hacks" rel="nofollow">http://www.webdevout.net/css-hacks</a></p>
<p>very helpful back in the days..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: theallan</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273090</link>
		<dc:creator>theallan</dc:creator>
		<pubDate>Sat, 25 Apr 2009 06:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273090</guid>
		<description>Nice collection of hacks. Another option is to use server-side processing with something like Conditional-CSS, which allows IE style conditions inline with your script: http://www.conditional-css.com .

I remember hearing that Chris Wilson had actually originally wanted conditional comments to go into style sheets (perhaps in the Tech Luminaries interview?) - this way you can.</description>
		<content:encoded><![CDATA[<p>Nice collection of hacks. Another option is to use server-side processing with something like Conditional-CSS, which allows IE style conditions inline with your script: <a href="http://www.conditional-css.com" rel="nofollow">http://www.conditional-css.com</a> .</p>
<p>I remember hearing that Chris Wilson had actually originally wanted conditional comments to go into style sheets (perhaps in the Tech Luminaries interview?) &#8211; this way you can.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csuwldcat</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273084</link>
		<dc:creator>csuwldcat</dc:creator>
		<pubDate>Fri, 24 Apr 2009 21:18:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273084</guid>
		<description>so you are saying dojo parses those classes by grabbing the tag name arrays and then normalizes across browsers?  While that certainly would seem another way, what happens if the lib or any js hangs or blocks for the user?  I am guessing they get an unpleasant page snap from f*ed to fixed, depending on the css that originally renders that can be pretty jarring if it is a super bad float issue or something that has the page noticeably tweaked.  You know what I mean?</description>
		<content:encoded><![CDATA[<p>so you are saying dojo parses those classes by grabbing the tag name arrays and then normalizes across browsers?  While that certainly would seem another way, what happens if the lib or any js hangs or blocks for the user?  I am guessing they get an unpleasant page snap from f*ed to fixed, depending on the css that originally renders that can be pretty jarring if it is a super bad float issue or something that has the page noticeably tweaked.  You know what I mean?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AnM8tR</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273082</link>
		<dc:creator>AnM8tR</dc:creator>
		<pubDate>Fri, 24 Apr 2009 18:35:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273082</guid>
		<description>Dare I say... just use Dojo?

It adds helpful classes to to the HTML tag, like dj_ie dj_ie6 or dj_gecko dj_ff, etc.

Then you add just add a definition that starts with one of those classes. 

I think this is not only brilliant, but very readable too.</description>
		<content:encoded><![CDATA[<p>Dare I say&#8230; just use Dojo?</p>
<p>It adds helpful classes to to the HTML tag, like dj_ie dj_ie6 or dj_gecko dj_ff, etc.</p>
<p>Then you add just add a definition that starts with one of those classes. </p>
<p>I think this is not only brilliant, but very readable too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csuwldcat</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273081</link>
		<dc:creator>csuwldcat</dc:creator>
		<pubDate>Fri, 24 Apr 2009 18:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273081</guid>
		<description>I found that code on a couple sites, this is one:
http://my.opera.com/dbloom/blog/2009/03/11/css-hack-for-ie8-standards-mode

I don&#039;t want to take credit for what is not mine!</description>
		<content:encoded><![CDATA[<p>I found that code on a couple sites, this is one:<br />
<a href="http://my.opera.com/dbloom/blog/2009/03/11/css-hack-for-ie8-standards-mode" rel="nofollow">http://my.opera.com/dbloom/blog/2009/03/11/css-hack-for-ie8-standards-mode</a></p>
<p>I don&#8217;t want to take credit for what is not mine!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: csuwldcat</title>
		<link>http://ajaxian.com/archives/css-browser-hacks/comment-page-1#comment-273080</link>
		<dc:creator>csuwldcat</dc:creator>
		<pubDate>Fri, 24 Apr 2009 18:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=6646#comment-273080</guid>
		<description>You forgot a couple reallllllly helpful ones:

ALL IE VERSIONS:

#somediv{
  width: 100px\9;
}
 
IE8 STANDARDS MODE ONLY:

#somediv{
  width /*\**/: 100px\9;
}

I hate to say it but I have a little internal rule about these things, if there is only one or two, i use them and heavily comment the css file where they reside.  Don&#039;t hate!</description>
		<content:encoded><![CDATA[<p>You forgot a couple reallllllly helpful ones:</p>
<p>ALL IE VERSIONS:</p>
<p>#somediv{<br />
  width: 100px\9;<br />
}</p>
<p>IE8 STANDARDS MODE ONLY:</p>
<p>#somediv{<br />
  width /*\**/: 100px\9;<br />
}</p>
<p>I hate to say it but I have a little internal rule about these things, if there is only one or two, i use them and heavily comment the css file where they reside.  Don&#8217;t hate!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

