我在 Firefox 和 MSIE 中实现 DIN 字体时遇到问题。它在 Chrome 中运行良好。
导入代码如下:
@font-face {
font-family: DINweb;
src: url('/wp-content/themes/quickstep-child/DINWeb.eot');
src: url('/wp-content/themes/quickstep-child/DINWeb.eot?#iefix') format('embedded-opentype'),
url('/wp-content/themes/quickstep-child/DINWeb.woff') format('woff'),
url('/wp-content/themes/quickstep-child/DINWeb.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
字体在 CSS 中是这样调用的:
font-family: DINWeb, sans-serif!important;
最佳答案
这个语法对我有用:
@font-face {
font-family: 'DIN_Medium';
src: url('../fonts/DIN_Medium.eot'); /* IE9 Compatibility Modes */
src: url('../fonts/DIN_Medium.eot?') format('eot'), /* IE6-IE8 */
url('../fonts/DIN_Medium.otf') format('otf'),
url('../fonts/DIN_Medium.ttf') format('truetype'); /* Safari, Android, iOS */
}
如果您没有扩展名,您可以在这里生成它们 http://www.freefontconverter.com/
关于css - Firefox 和 IE 中的 DIN webfont 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16731507/