Css @字体不使用';即使来源正确,也无法工作

Css @字体不使用';即使来源正确,也无法工作,css,import,font-face,Css,Import,Font Face,我只是想导入并使用我在上面生成的字体 这是我嵌入字体的css: @font-face { font-family: 'robotothin'; src: url('../fonts/webfont/roboto-thin-webfont.eot'); src: url('../fonts/webfont/roboto-thin-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/

我只是想导入并使用我在上面生成的字体

这是我嵌入字体的css:

@font-face {
    font-family: 'robotothin';
    src: url('../fonts/webfont/roboto-thin-webfont.eot');
    src: url('../fonts/webfont/roboto-thin-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/webfont/roboto-thin-webfont.woff2') format('woff2'),
         url('../fonts/webfont/roboto-thin-webfont.woff') format('woff'),
         url('../fonts/webfont/roboto-thin-webfont.ttf') format('truetype'),
         url('../fonts/webfont/roboto-thin-webfont.svg#robotothin') format('svg');
    font-weight: normal;
    font-style: normal;

}
这就是我试图利用它的方式

html, body{
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'robotothin';
    font-weight: normal;
    font-style: normal;
}
这就是我储存字体的地方


只是不知道为什么它不起作用。请帮帮我

使用该字体的谷歌字体版本 将此添加到您的html中

<link href='http://fonts.googleapis.com/css?family=Roboto:500,900italic,900,400italic,100,700italic,300,700,500italic,100italic,300italic,400&subset=latin,cyrillic-ext,latin-ext,cyrillic,greek-ext,greek,vietnamese' rel='stylesheet' type='text/css'>

下面是一个正在运行的示例

当您尝试加载页面时,是否在浏览器控制台中看到任何消息?例如,当它尝试下载字体时是否得到HTTP 404?不,我已经检查了控制台错误,但没有!你的字体是由网络服务器提供的吗?其中一个roboto-*-demo.html是否正常工作?@slime我必须打开一个文件夹,因为我的css放在fonts文件夹旁边的另一个文件夹中。@gearsdigital我正在本地使用xamppthanks获取提示。我甚至不知道谷歌上有这个。不管怎么说,这有点奇怪,为什么它不适用于我的本地字体…没问题。我希望我的解决方案对你有帮助?其实这不是我问题的解决方案,而是一个很好的选择,谢谢!我很高兴,如果你觉得有帮助的话,请接受我的回答。如果需要进一步帮助,也可以发表评论。关于你的问题,我相信问题出在服务器上,因为CSS没有明显的问题。这很有帮助,这就是为什么我投了赞成票,但这不是我问题的解决方案
font-family: 'Roboto', sans-serif;