我想给网站添加字体,但我不能让它在 IE7 和 IE8 中工作。 它适用于 Firefox、Chrome 和 IE 9。我尝试了一些我找到的解决方案,但没有一个有效。 我试过这个:
@font-face {
font-family: 'MyriadPro-SemiboldCond';
src: url('/static/fonts/MyriadPro-SemiboldCond.eot');
src: local('☺'), url('/static/fonts/MyriadPro-SemiboldCond.woff') format('woff'), url('/static/fonts/MyriadPro-SemiboldCond.ttf') format('truetype'), url('/static/fonts/MyriadPro-SemiboldCond.svg') format('svg');
font-weight: normal;
font-style: normal;
}
也试过这个:
@font-face {
font-family: 'MyriadPro-SemiboldCond';
src: url('/static/fonts/MyriadPro-SemiboldCond.eot');
src: url('/static/fonts/MyriadPro-SemiboldCond.eot?#iefix') format('embedded-opentype'),
url('/static/fonts/MyriadPro-SemiboldCond.woff') format('woff'),
url('/static/fonts/MyriadPro-SemiboldCond.ttf') format('truetype'),
url('/static/fonts/MyriadPro-SemiboldCond.svg#MyriadPro-SemiboldCond') format('svg');
font-weight: normal;
font-style: normal;
}
它看起来不错,但显然我遗漏了一些东西。我不知道我使用的字体“MyriadPro”是否有问题。
在 IE7/IE8 中还有其他方法吗? cufon 等 javascript 解决方案使文本无法选择。
最佳答案
这对我来说在 IE7 和 8 中工作正常,但如果发生这样的问题,那么你应该查看另一个选项,如 googlefonts
@font-face {
font-family: 'DroidSansMono';
src: url('../fonts/droid_sans_mono_regular-webfont.eot');
src: url('../fonts/droid_sans_mono_regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/droid_sans_mono_regular-webfont.woff') format('woff'),
url('../fonts/droid_sans_mono_regular-webfont.ttf') format('truetype'),
url('../fonts/droid_sans_mono_regular-webfont.svg#DroidSansMono') format('svg');
font-weight: normal;
font-style: normal;
}
使用谷歌字体:
<link href='http://fonts.googleapis.com/css?family=Berkshire+Swash|Press+Start+2P' rel='stylesheet' type='text/css' />
关于html - 字体不工作 IE7/IE 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19233972/