【问题标题】:How to target Firefox browser specifically? [duplicate]如何专门针对 Firefox 浏览器? [复制]
【发布时间】:2017-04-21 08:13:08
【问题描述】:

我的字体在 Firefox 上无法正确呈现某些字符。如果检测到 Firefox,我想将字体更改为其他字体。我尝试了这种技术:

body:not(:-moz-handler-blocked) .altFont { 
  font-family: helvetica, arial, sans-serifs !important;
}

它不起作用,并且在 Firefox 网站上它说不推荐。我想知道是否有其他方法可以检查?

【问题讨论】:

    标签: javascript css firefox


    【解决方案1】:

    使用以下语法来定位任何版本的 Firefox 浏览器:

    @-moz-document url-prefix() { 
      /* Styles to be executed on firefox */
      body .altFont {
        font-family: helvetica, arial, sans-serifs !important;
      }
    }
    

    参考:CSS hacks targeting firefox

    【讨论】:

      猜你喜欢
      • 2012-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-08
      • 2019-08-03
      • 1970-01-01
      • 2018-02-08
      相关资源
      最近更新 更多