我正在尝试从我的本地文件夹中调用我的本地字体,这些字体名为fonts,但这些字体不是在css中加载而在下面是
@font-face {
font-weight: normal;
font-style: normal;
font-family: 'ProximaNova';
src: url('fonts/ProximaNova-Regular.eot');
src: url('fonts/ProximaNova-Regular.woff2') format('woff2'),
url('fonts/ProximaNova-Regular.woff') format('woff'),
url('fonts/ProximaNova-Regular.ttf') format('truetype'),
url('fonts/ProximaNova-Regular.svg') format('svg');
}
先谢谢
答案 0 :(得分:1)
检查您的路径,最佳做法是始终使用相对路径
应该是,
@font-face {
font-weight: normal;
font-style: normal;
font-family: 'ProximaNova';
src: url('../sources/fonts/ProximaNova-Regular.eot');
src: url('../sources/fonts/ProximaNova-Regular.woff2') format('woff2'),
url('../sources/fonts/ProximaNova-Regular.woff') format('woff'),
url('../sources/fonts/ProximaNova-Regular.ttf') format('truetype'),
url('../sources/fonts/ProximaNova-Regular.svg') format('svg');
}