我设法使用一种自定义字体,该字体适用于每个值得被称为“浏览器”的浏览器。出色地一如既往这些很酷的东西不适用于 ie(在本例中为 ie9)。
我尝试了以下方法:
@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');}
经过一些提示后,我在谷歌上发现了这一点,我尝试了:
@font-face { font-family: Roboto; src: url('../fonts/roboto/Roboto-Regular.ttf');
src: url('../fonts/roboto/Roboto-Regular.ttf#') format('truetype');
font-weight: normal;
font-style: normal;}
仍然没有成功。好吧,根据我的经验,这个问题不会有“好的”解决方案,但也许有人发现了另一个糟糕的 ie hack,让我摆脱了另一个 ie 的痛苦。
您需要添加 .eot 格式才能被 IE9 识别。
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
source
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)