4 ms·
I find I rarely need to target any browser other than IE with specific styles, so I usually end up doing something like this, which doesn't rely on JS. <!--
by kaylarose 16y ago
I find I rarely need to target any browser other than IE with specific styles, so I usually end up doing something like this, which doesn't rely on JS.
<!--[if lt IE 7]><html lang="en" class="no-js ie ie6"><![endif]-->
<!--[if IE 7]><html lang="en" class="no-js ie ie7"><![endif]-->
<!--[if IE 8]><html lang="en" class="no-js ie ie8"><![endif]-->
<!--[if IE 9]><html lang="en" class="no-js ie ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
Edit: And then remove the 'no-js' class with js
- Pewpewarrows 16y agoCredit where credit is due: http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ http://paulirish.com/2008/conditional-stylesheets-vs-css-hac...
- kaylarose 16y agoActually I didn't know about that article, but is nice to see the origin of this technique. Mostly took inspiration from HTML5 Boilerplate (also Paul Irish), and previous articles I read. But yes, Paul Irish is awesome, and deserves lots of credit.