Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 首次访问时未加载自定义字体_Html_Css_Wordpress_Google Chrome_Fonts - Fatal编程技术网

Html 首次访问时未加载自定义字体

Html 首次访问时未加载自定义字体,html,css,wordpress,google-chrome,fonts,Html,Css,Wordpress,Google Chrome,Fonts,我创建了一个新网站()并使用了一种自定义字体,我将其包含在style.css中。我以前使用过自定义字体,从未遇到过任何问题。这次我有以下问题: 当我第一次访问页面或清空缓存后,字体不会加载。换句话说:没有文本。它没有使用其他字体,但根本没有。不过,这似乎给这些词留下了空间。它似乎是看不见的。当我点击页面上的任何地方时,它就会被加载,并且在接下来的每次访问中,它都会出现在那里 问题似乎只存在于当前的Chrome中 我尝试将其添加到导入所有其他样式表的style.css中,并添加到使用该字体的样式表

我创建了一个新网站()并使用了一种自定义字体,我将其包含在style.css中。我以前使用过自定义字体,从未遇到过任何问题。这次我有以下问题:

当我第一次访问页面或清空缓存后,字体不会加载。换句话说:没有文本。它没有使用其他字体,但根本没有。不过,这似乎给这些词留下了空间。它似乎是看不见的。当我点击页面上的任何地方时,它就会被加载,并且在接下来的每次访问中,它都会出现在那里

问题似乎只存在于当前的Chrome中

我尝试将其添加到导入所有其他样式表的style.css中,并添加到使用该字体的样式表的最顶部。两个人都没用

我尝试重命名字体文件和字体名称,但没有成功

代码如下:

@font-face {

font-family: 'aaarghnormal';
  src: url('../katebreuerme/fonts/aaargh.eot');
  src: url('../katebreuerme/fonts/aaargh.eot?#iefix') format('embedded-opentype'),
  url('../katebreuerme/fonts/aaargh.woff') format('woff'),
  url('../katebreuerme/fonts/aaargh.ttf') format('truetype'),
  url('../katebreuerme/fonts/aaargh.svg#aaarghnormal') format('svg');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "aaarghnormal", Helvetica, Century Gothic, Verdana, sans-serif, serif, Courier, monospace;
}
有没有办法解决这个问题?如果我的读者在第一次访问时没有看到字体,我认为这不是件好事


谢谢

也许没什么,但你有:

@import url("css/style.css");

@font-face {
    font-family: 'aaarghnormal';
    src: url('../katebreuerme/fonts/aaargh.eot');
    src: url('../katebreuerme/fonts/aaargh.eot?#iefix') format('embedded-opentype'),
    url('../katebreuerme/fonts/aaargh.woff') format('woff'),
    url('../katebreuerme/fonts/aaargh.ttf') format('truetype'),
    url('../katebreuerme/fonts/aaargh.svg#aaarghnormal') format('svg');
    font-weight: normal;
    font-style: normal;
}
您的css/style.css是否使用该字体? 因为可能是第一次还没有加载字体,而您尝试在css/style.css上使用它,我错了吗

尝试更改此设置并首先加载字体,并将css/style.css直接包含在html文件中。。
不确定这是否能解决您的问题,但尝试不需要任何费用

请提供您的css。在Chrome中,一切似乎都很好。。。这个问题在匿名模式下也会发生吗?bprayudha,我在上面进行了编辑以添加代码。是的,在icognito模式下和不同的计算机上也会发生。@bekate您能解决这个问题吗?我遇到了完全相同的问题(在谷歌浏览器中)嗨,已经试过了。如果我把@import放在字体下面,它根本不会加载css。现在,我将字体部分移回导入的css文件,在使用它之前加载它,但这没有任何区别。无论我将字体部分移动到何处,问题仍在发生。