Is it possible to detect Firefox users in pure CSS?

zur4ik picture zur4ik · May 3, 2011 · Viewed 19.9k times · Source

Is it possible to detect Firefox Browser only with CSS like IE?

for example, IE browser can be detected like:

<!--[if IE 7]>
   /* IMPORTING CSS FOR IE */
<![endif]-->

Can be Firefox browser detected like this code?

Answer

Stanley Cup Phil picture Stanley Cup Phil · May 3, 2011

Not that I know of, but you can try this:

@-moz-document url-prefix() {
 
    #my-id { font-size: 100%; }
 
}

This website has more options as well

You can place this in your CSS file or between your <style type='text/css'> tags in your HTML. Works Fine!