Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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 WebFont赢得';不显示_Html_Css_Fonts - Fatal编程技术网

Html WebFont赢得';不显示

Html WebFont赢得';不显示,html,css,fonts,Html,Css,Fonts,因此,我想为我的网页正文设置一种字体,因此我用以下代码创建了一个core.css文件: @font-face { font-family: Bebas; src: url('../fonts/bebas-webfont.ttf') format('truetype'), url('../fonts/bebas-webfont.eot') format('embedded-opentype'), url('../fonts/bebas-webfont.woff') forma

因此,我想为我的网页正文设置一种字体,因此我用以下代码创建了一个core.css文件:

@font-face {
font-family: Bebas; 
src: url('../fonts/bebas-webfont.ttf') format('truetype'),
     url('../fonts/bebas-webfont.eot') format('embedded-opentype'),
     url('../fonts/bebas-webfont.woff') format('woff'),
     url('../fonts/bebas-webfont.svg') format('svg');
font-weight: 700;
}

body{
background: url('../images/bg_1.png')repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: 'Bebas', serif;
}
但它似乎没有出现。。。甚至当我尝试
。。。我用另一种字体尝试了一下,效果很好,我不知道是怎么回事。字体文件位于正确的位置

解决方案: 当我使用两种字体时,我忘了使用两种不同的@font-face{
一旦我把它们分开,它们就像一个符咒一样工作

您在这里创建的是weight=700的字体。尝试将字体eweight:700;添加到正文:

body{
background: url('../images/bg_1.png')repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
font-family: 'Bebas', serif;
font-weight:700;
}

检查浏览器开发人员控制台。答案就在那里。
另外,路径是相对于css文件的,而不是html文件。这里不需要字体权重。

因为我使用了两种字体,所以忘了使用两种不同的@font-face{一旦我把它们分开,像个符咒一样工作

显然没问题……URL是正确的吗?字体是否位于该位置?你应该假装你从未听说过
标记字体位于public\u html/font上没有足够的信息。我们无法访问“public\u html/fonts”“。并且没有包含HTML。删除权重后,该路径对于其他字体效果良好,仅此一个…弹出4个警告,与此css文件无关。”