仅针对firefox pc的css媒体查询

nic*_*ick 5 css html5

我想为我的页面添加一个特定的样式,但只在运行在PC上的Firefox上.我用这个代码只针对mac,但是windows会等同于什么?有没有办法用媒体查询而不是javascript来做到这一点?

var FF = !(window.mozInnerScreenX == null);

if(FF) {
    if(navigator.platform.indexOf('Mac')>=0)
         {
            // is a mac and on firefox
         }
Run Code Online (Sandbox Code Playgroud)

Ben*_*min 8

用于Firefox的Css hack

@-moz-document url-prefix() { 
  .cssSelector {
     font-size: 14px;
  }
}
Run Code Online (Sandbox Code Playgroud)

参考