@ font-face不能处理一个特定的字体

时间:2017-02-03 05:01:28

标签: html css fonts cross-browser font-face

我正在尝试为客户端启动并运行一个站点,但我遇到了字体问题。所有字体都正常工作,除了一个,我不知道为什么。在2种字体不起作用的Internet Explorer中,问题更严重,在Edge中没有任何作用。这是我正在使用的代码。无法使用的字体是“chunkfive”。

@font-face {
    font-family: 'chunkfive';
    src: url('fonts/chunkfive-webfont-webfont.woff2') format('woff2'),
         url('fonts/chunkfive-webfont-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'roboto';
    src: url('fonts/roboto-regular-webfont.woff2') format('woff2'),
         url('fonts/roboto-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'streetwear';
    src: url('fonts/streetwear-webfont.woff2') format('woff2'),
         url('fonts/streetwear-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: streetwear, serif;
}

nav {
    background: #000;
    border: solid 4px #FFF;
    font-family: chunkfive, serif;
    font-size: 22px;
    left: 50%;
    margin-left: -425px;
    position: absolute;
    top: 143px;
    width: 850px;
    z-index: 0;
}

ol,
p,
ul {
    font-family: roboto, sans-serif;
    font-size: 18px;
}

这些字体在我的免费网站上完美运行,但是当在GoDaddy的帐户上发布时,它们无法正常工作。使用chrome,我得到每个字体的以下错误,即使chunkfive以外的字体显示正确:

GET http://website-url.com/css/fonts/streetwear-webfont.woff2 

GoDaddy会以某种方式限制您使用字体的方式,还是我需要修复其他内容?

1 个答案:

答案 0 :(得分:0)

你可以做2-3件事来解决这个问题 -  1.检查链接是否正确。  2.尝试使用双引号而不是单引号。  3.检查字体文件夹预设,因为这是go daddy的主要问题。