Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect Firefox users in pure CSS?

Tags:

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?

like image 786
zur4ik Avatar asked May 03 '11 18:05

zur4ik


People also ask

Can CSS detect browser?

The closest you can come with pure CSS is with feature queries. Instead of detecting the browser type/version, it allows you to check if a specific property/value combinations are supported by the browser. And, of course, IE does not support "supports," which I need to use solely for IE.

How do I know if my browser is CSS Firefox?

Any CSS at-rule that starts with @-moz- is a Gecko-engine-specific rule, not a standard rule. That is, it is a Mozilla-specific extension. The url-prefix rule applies the contained style rules to any page whose URL starts with it.

How do I only use CSS in Firefox?

Method 1: This method uses Mozilla specific extension to add CSS property. This extension supply the CSS property only in Firefox browser. Method 2: The -moz-appearance CSS property is used in Gecko (Firefox) to display an element using platform-native styling based on the operating system's theme.


1 Answers

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!

like image 99
Soatl Avatar answered Sep 22 '22 01:09

Soatl