All Browser CSS Hack

aad-ban

<style type=”text/css”>
.ie .example {background-color: yellow}
.ie7 .example {background-color: orange}
.gecko .example {background-color: gray}
.win.gecko .example {background-color: red}
.linux.gecko .example {background-color: pink}
.opera .example {background-color: green}
.konqueror .example {background-color: blue}
.webkit .example {background-color: black}
.example {width: 100px;height: 100px;}
.no_js { display: block }
.has_js { display: none }
.js .no_js { display: none }
.js .has_js { display: block }
</style>

<script type=”text/javascript” charset=”utf-8″>

function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g=’gecko’,w=’webkit’,s=’safari’,o=’opera’,m=’mobile’,h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?(‘ie ie’+RegExp.$1):is(‘firefox/2′)?g+’ ff2′:is(‘firefox/3.5′)?g+’ ff3 ff3_5′:is(‘firefox/3.6′)?g+’ ff3 ff3_6′:is(‘firefox/3′)?g+’ ff3′:is(‘gecko/’)?g:is(‘opera’)?o+(/version\/(\d+)/.test(ua)?’ ‘+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?’ ‘+o+RegExp.$2:”)):is(‘konqueror’)?’konqueror’:is(‘blackberry’)?m+’ blackberry’:is(‘android’)?m+’ android’:is(‘chrome’)?w+’ chrome’:is(‘iron’)?w+’ iron’:is(‘applewebkit/’)?w+’ ‘+s+(/version\/(\d+)/.test(ua)?’ ‘+s+RegExp.$1:”):is(‘mozilla/’)?g:”,is(‘j2me’)?m+’ j2me’:is(‘iphone’)?m+’ iphone’:is(‘ipod’)?m+’ ipod’:is(‘ipad’)?m+’ ipad’:is(‘mac’)?’mac’:is(‘darwin’)?’mac’:is(‘webtv’)?’webtv’:is(‘win’)?’win’+(is(‘windows nt 6.0′)?’ vista’:”):is(‘freebsd’)?’freebsd’:(is(‘x11’)||is(‘linux’))?’linux’:”,’js’]; c = b.join(‘ ‘); h.className += ‘ ‘+c; return c;}; css_browser_selector(navigator.userAgent);
</script>

</head>

<body>

<div></div>
</body>

aad-ban1

Advertisements

150 thoughts on “All Browser CSS Hack

  1. This is really interesting, You are a very skilled blogger.

    I have joined your feed and look forward to seeking more of your great post.
    Also, I have shared your site in my social networks!

  2. Hello very cool blog!! Guy .. Beautiful .. Superb .
    . I will bookmark your website and take the feeds additionally?
    I’m glad to seek out a lot of useful information here within the post, we need develop more techniques on this regard, thanks for sharing. . . . . .

  3. This is the right web site for anyone who wants to understand this topic.
    You know a whole lot its almost hard to argue with you
    (not that I actually will need to…HaHa). You certainly put a brand new spin on a subject
    that has been discussed for many years. Excellent stuff, just great!

  4. I simply could not go away your web site prior to suggesting that I
    extremely enjoyed the standard information a person
    supply for your visitors? Is gonna be back often in order to investigate cross-check new posts

  5. Greetings! I know this is kind of off topic
    but I was wondering which blog platform are you using for this site?
    I’m getting sick and tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.

  6. Right here is the perfect webpage for everyone who wishes to find out
    about this topic. You understand so much its almost hard to argue with you (not that I really would
    want to…HaHa). You definitely put a fresh spin on a subject which has been discussed
    for many years. Excellent stuff, just excellent!

  7. Excellent blog here! Also your site loads up fast!
    What web host are you using? Can I get your affiliate
    link to your host? I wish my web site loaded up as fast as yours lol

  8. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You definitely know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something informative to read?

  9. The next time I read a weblog, I hope that it doesnt disappoint me as much as this one. I imply, I do know it was my choice to learn, but I actually thought youd have something attention-grabbing to say. All I hear is a bunch of whining about one thing that you could repair in case you werent too busy searching for attention.

  10. Normally I do not learn article on blogs, however I wish to say that this write-up very compelled me to check out and do it! Your writing taste has been amazed me. Thanks, very great article.

  11. I do agree with all of the ideas you have presented in your post. They are really convincing and will definitely work. Still, the posts are too short for novices. Could you please extend them a little from next time? Thanks for the post.

  12. When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove people from that service? Thanks a lot!

  13. Nice read, I just passed this onto a friend who was doing a little research on that. And he actually bought me lunch since I found it for him smile Therefore let me rephrase that: Thank you for lunch!

  14. Hey I know this is off topic but I was wondering if you knew
    of any widgets I could add to my blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  15. Howdy! This is kind of off topic but I need some advice
    from an established blog. Is it tough to set up your
    own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about
    setting up my own but I’m not sure where to begin. Do you have any ideas or suggestions? Appreciate it

  16. Thanks a lot for sharing this with all of us you actually realize what you’re talking about! Bookmarked. Kindly also visit my web site =). We may have a hyperlink change contract among us

  17. What’s up it’s me, I am also visiting this web site on a regular basis, this web site
    is actually fastidious and the visitors are really sharing nice thoughts.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s