1

我想为网站添加字体,但无法在 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 解决方案使文本无法选择。

4

1 回答 1

1

这在 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' />
于 2013-10-07T20:29:23.140 回答