我是@font-face 的菜鸟。我浏览了这里的所有帖子和几个教程,但我无法弄清楚为什么我的字体没有加载。我正在激活和停用字体以查看它是否通过服务器加载而没有运气。奇怪的是当它被激活时,它在浏览器中工作但在本地不工作。
我在 fonts 文件夹中有 css 文件并全部上传到服务器。我已经测试了字体附带的演示文件并且工作正常。
我确定我错过了一些非常基本的东西,我会觉得自己很愚蠢。
这是我的@font-face CSS:
@font-face {
font-family: 'capsuularegular';
src: url('fonts/Capsuula-webfont.eot');
src: url('fonts/Capsuula-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/Capsuula-webfont.woff') format('woff'),
url('fonts/Capsuula-webfont.ttf') format('truetype'),
url('fonts/Capsuula-webfont.svg#capsuularegular') format('svg');
font-weight: normal;
font-style: normal;
这是我试图让它运行的页面: http://takatech.com/index.2.html#
非常感谢任何帮助。
最佳答案
这是因为字体系列是 capsuularegular
而你在#main-wide Capsuula
因此,将您的 CSS 更改为:
#main-wide {
color: #999999;
font-family: "capsuularegular";
font-size: 14px;
line-height: 30px;
text-align: left;
}
关于html - @font-face 未在任何浏览器中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21484029/