下面的代码有没有错误?
@font-face {
font-family: 'raveFire';
src: url('ravefire.eot');
src: local('raveFire'), url('ravefire.ttf') format('truetype');
}
此代码位于文件“style.css”中,文件 ravefire.ttf 和 ravefire.eot 与“style.css”位于同一文件夹中 ...
我尝试在 span、style、class 等中使用这个新的字体系列......我也尝试了几种浏览器......
请问有什么帮助吗?
最佳答案
我最近一直在使用 font-face,但我没有看到“本地”引用,请尝试一下,即:
@font-face {
font-family: 'raveFire';
font-style: normal;
font-weight: normal;
src: url('ravefire.eot') format('eot'), url('ravefire.ttf') format('truetype');
}
确保您的字体与页面位于同一文件夹中,或者使用它们的绝对路径。
关于html - 使用@font-face 添加新字体不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7432800/