Page 1 of 1

To Target Specific Browsers:

Posted: Sun Jan 11, 2009 6:28 am
by Dr.CSS
To Target Specific Browsers:

#ID or .class is like div#main or div.main

* html #ID or .class {
  ie6
}

NOTE: sometimes IE6 requires...

* html body #ID or .class {
   ie6
}

*:first-child+html #ID or .class {
  ie7
}

#ID or .class, x:-moz-any-link, x:default {
   FF3
}

body:nth-of-type( ) #ID or .class {
   OLDER versions of: chrome and safari
}
      OR

body:nth-of-type(1) #ID or .class {
  chrome and safari, this will just target the 1st one
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
#ID or .class {
new versions of chrome and safari
}
}

First time ever I had to target Firefox only as all other browsers showed the same thing...

@-moz-document url-prefix() {
#ID or .class {
for latest firefox
}
}

Re: To Target Specific Browsers:

Posted: Sun Feb 15, 2009 3:52 pm
by CWebguy
Thanks for this.

Re: To Target Specific Browsers:

Posted: Thu Mar 05, 2009 2:00 pm
by christiaans
Could come in handy, but the thing is that your css will not validate.

Another option would be a simple javascript detection browser, and then passing on a class for that specific browser. (fairly easy to do, but only for specific elements and such..)

Re: To Target Specific Browsers:

Posted: Sat Dec 12, 2009 8:36 am
by hexdj
antosha wrote: If I understand correctly, the tags in the template won't work?
They will work, you just have to wrap them in the smarty {literal}{/literal} tags for example:

Code: Select all

{literal}
<!--[if IE 6]>
  <p>Your browser sucks</p>
<![endif]>
{/literal}

Re: To Target Specific Browsers:

Posted: Fri Mar 05, 2010 5:10 pm
by JeremyBASS
Just figured I throw this here.. a handy tool I use alot for this.. browsertools Cheers -Jeremy

Re: To Target Specific Browsers:

Posted: Thu Oct 14, 2010 1:19 pm
by Inzman
There's also a way with javascript:
http://rafael.adm.br/css_browser_selector/

Very handy script, can target browsers and their different versions.

Re: To Target Specific Browsers:

Posted: Sun Oct 07, 2012 1:42 pm
by rooon
Or use browser detection
for example http://forum.cmsmadesimple.org/viewtopi ... =4&t=63334