Html 我的自定义Webfont未在任何浏览器中呈现

Html 我的自定义Webfont未在任何浏览器中呈现,html,css,Html,Css,请帮我修改密码。 我的自定义字体似乎无法在我打开的任何浏览器上呈现 这是我的CSS代码 @font-face{ font-family: 'Guildford'; src: url('../fonts/guildford_pro_titling-webfont.woff') format('woff'), src: url('../fonts/guildford_pro_titling-webfont.woff2') format('woff2'), src: url('../fonts/gui

请帮我修改密码。 我的自定义字体似乎无法在我打开的任何浏览器上呈现

这是我的CSS代码

@font-face{
font-family: 'Guildford';
src: url('../fonts/guildford_pro_titling-webfont.woff') format('woff'),
src: url('../fonts/guildford_pro_titling-webfont.woff2') format('woff2'),
src: url('../fonts/guildford_pro_titling-webfont.eot') format(embedded-opentype),
src: url('../fonts/guildford_pro_titling.otf') format('opentype') !Important;}

body {
font-family: 'Guildford', sans-serif;
background-image: url(../img/staropaquebackground.png);
background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
color: #ffffff;}
试试这个:

@font-face{
font-family: 'Guildford';
src: url('../fonts/guildford_pro_titling-webfont.woff') format('woff'),
url('../fonts/guildford_pro_titling-webfont.woff2') format('woff2'),
url('../fonts/guildford_pro_titling-webfont.eot') format(embedded-opentype),
url('../fonts/guildford_pro_titling.otf') format('opentype') !important;
}

body {
font-family: 'Guildford', sans-serif;
background-image: url(../img/staropaquebackground.png);
background-size: cover;
background-attachment: fixed;
background-repeat: no-repeat;
color: #ffffff;
}
基本上,您需要用分号替换逗号,并删除多个“src:”声明。 我推荐任何带有代码验证的代码编辑器,以避免将来出现此类问题


您有一些错误,如果您选择了,这些错误将被发现

看看:

不要在每个URL之前指定
src:

属性名称只能提及一次


然后是一个以逗号分隔的值列表。

我敢肯定,在以逗号分隔URL时,您不需要在每一行上都使用
src
。否。您现在重新声明了
src
,而不是为其指定多个值。谢谢,但它仍然没有调用字体。@EdwardBella还请确保您的路径指向字体文件。
@font-face {
 font-family: "Open Sans";
 src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
        url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}