html - Lato 字体在 Firefox 中损坏

标签 html css firefox fonts

我使用 Lato Google 字体开发了一个网站。在 Chrome 上一切正常,但当我使用 Firefox 时,字体损坏,我得到的是 Times New Roman 字体。

奇怪的是,当我打开 https://www.google.com/fonts/specimen/Lato我确实得到了拉托字体。所以我的猜测是我的代码有问题。

网址是http://www.okaprix.com/ 这是我为使用 Lato 字体而编写的 CSS 代码:

/* latin-ext */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v11/UyBMtLsHKBKXelqf4x7VRQ.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url(http://fonts.gstatic.com/s/lato/v11/1YwB1sO8YE1Lyjf12WNiUA.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
body {
font-family : Lato;
margin : 0 auto;
height : 100%;
font-size: 16px;
min-width:1066px;
}

最佳答案

这不是您实现 Google 字体的方式。在页面的 head 中使用以下标记:

<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>

然后只需在样式表中指定 Lato。

关于html - Lato 字体在 Firefox 中损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31158847/

相关文章:

html - 滚动内滚动不起作用

html - 使用英特尔应用程序框架进行离线缓存?

javascript - 使用下拉选择列表和框来存储选定的选项

html - CSS hover - 如何让它改变两个嵌套的 div

javascript - X 秒后仅刷新指定的 div?

javascript - 火狐浏览器奇怪的问题

html - 将页面宽度固定为 100% CSS

javascript - 如何让一个视频暂停、播放另一个视频以及恢复到原始视频

css - 为什么我的线性渐变在 Firefox 中不起作用?

html - 为什么过渡从自动对焦开始?