我正在尝试使用Bones Wordpress主题中的自定义字体。我的字体系列在“library> fonts”文件夹中,就像主题说明一样。
@font-face {
font-family: 'ColaborateThinRegular';
src: url('library/fonts/ColabThi-webfont.eot');
src: url('library/fonts/ColabThi-webfont.eot?#iefix') format('embedded-opentype'),
url('library/fonts/ColabThi-webfont.woff') format('woff'),
url('library/fonts/ColabThi-webfont.ttf') format('truetype'),
url('library/fonts/ColabThi-webfont.svg#ColaborateThinRegular') format('svg');
font-weight: normal;
font-style: normal;
}
我在我的样式表中调用它:
font-family: 'ColaborateThinRegular';
我尝试了很多不同的字体,但没有工作。我在这里缺少什么?
答案 0 :(得分:2)
我在骨骼上遇到了同样的问题,并使用相对路径来升级一个目录来修复它。对你来说应该是这样的:
@font-face {
font-family: 'ColaborateThinRegular';
src: url('../fonts/ColabThi-webfont.eot');
src: url('../fonts/ColabThi-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/ColabThi-webfont.woff') format('woff'),
url('../fonts/ColabThi-webfont.ttf') format('truetype'),
url('../fonts/ColabThi-webfont.svg#ColaborateThinRegular') format('svg');
font-weight: normal;
font-style: normal;
}
希望这有帮助!