自定义字体或CSS加载太晚了

时间:2014-03-16 19:56:41

标签: css font-face

我的CSS包括自定义字体,例如:

@font-face {
  font-family: 'AllerRegular';
  src: url("http://domain/css/fonts/aller_rg-webfont.eot");
  src: url('http://domain/css/fonts/aller_rg-webfont.eot?#iefix') format('embedded-opentype'), url('http://domain/css/fonts/aller_rg-webfont.woff') format('woff'), url('http://domain/css/fonts/aller_rg-webfont.ttf') format('truetype'), url('http://domain/css/fonts/aller_rg-webfont.svg#AllerRegular') format('svg');
  font-weight: normal;
  font-style: normal;
}
body {
  height: 100%;
  font-family: AllerRegular, sans-serif;
  font-size: 12px;
  color: #000000;
}

加载网页时,有时的几个段落似乎都缺少"。在Inspector中,然后我查看正文,取消选中font-family: AllerRegular, sans-serif;行,然后再次检查。文字回来了!

由于这个测试,我假设CSS和字体文件的加载顺序存在一些问题。

另请注意,CSS文件和字体文件不在同一服务器上托管。

enter image description here enter image description here

0 个答案:

没有答案
相关问题