Is it possible to detect Firefox users in pure CSS?

孤街浪徒 提交于 2020-07-17 06:13:09

问题


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?


回答1:


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!




回答2:


Nowadays you can use the @supports CSS rule:

@supports not( -moz-appearance:none ){
  /* Add non-firefox CSS code here */
}


来源:https://stackoverflow.com/questions/5874122/is-it-possible-to-detect-firefox-users-in-pure-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!