1

我在我的网站上使用了Ubuntu字体,当我这样做时 Opera 不会呈现页面:

html {
  font-family: 'Ubuntu', sans-serif;
}

所以我必须做 css 媒体查询:

/*Chrome*/
@media not all and (-webkit-min-device-pixel-ratio:0) {  
  html,
  button,
  input,
  select,
  textarea {
    font-family: 'Ubuntu',sans-serif;
  } 
}

/*Safari*/
@media screen and (-webkit-min-device-pixel-ratio:0) {
  html,
  button,
  input,
  select,
  textarea {
    font-family: 'Ubuntu',sans-serif;
  } 
}

/*Opera*/
@media not screen and (1) {
  html,
  button,
  input,
  select,
  textarea {
    font-family: sans-serif;
  } 
}

问题是现在我不知道如何为 Firefox 实现这个。搜索互联网并没有给我答案。

有任何想法吗?

亲切的问候。

4

2 回答 2

2

这样:

@media not all and (-moz-windows-compositor) { ... }

在这里查看更多信息:https ://developer.mozilla.org/en-US/docs/CSS/Media_queries

于 2012-08-21T15:51:10.473 回答
0

使用媒体查询-moz-windows-compositor,您只是针对 Windows/Linux 上的 Firefox,对于各种其他操作系统(如果您在那里的字体也有问题),您需要

 @media not all and (-moz-device-pixel-ratio) {…}
于 2013-02-15T21:05:47.933 回答