我在Web应用程序中使用了@ font-face,如下所示:
@font-face {
font-family: BKoodak;
src: url('../Content/Styles/ThirdParties/Fonts/BKoodakBold.eot'); /* IE9 Compatibility Modes */
src: url('../Content/Styles/ThirdParties/Fonts/BKoodakBold.eot?') format('eot'), /* IE6-IE8 */
url('../Content/Styles/ThirdParties/Fonts/BKoodakBold.woff') format('woff'), /* Modern Browsers */
url('../Content/Styles/ThirdParties/Fonts/BKoodakBold.ttf') format('truetype'); /* Safari, Android, iOS */
}
然后像这样使用它:
body {
line-height: 1;
font-family:BKoodak
}
问题是什么?
编辑:在网络选项卡(Chrome)中,我过滤了字体,但是我发现浏览器根本没有得到字体!在控制台中,我没有任何404错误!!我很困惑!怎么了?
最佳答案
您确定您的文件地址吗?
您可以使用此代码并更改文件地址
@font-face {
font-family: 'BKoodakBold';
src: url('fonts/BKoodakBold.eot?#') format('eot'), /* IE6–8 */
url('fonts/BKoodakBold.woff') format('woff'), /* FF3.6+, IE9, Chrome6+, Saf5.1+*/
url('fonts/BKoodakBold.ttf') format('truetype'); /* Saf3—5, Chrome4+, FF3.5, Opera 10+ */
}