Custom fonts not working in ie 8 and below

放肆的年华 提交于 2019-12-12 00:24:06

问题


My custom fonts aren't rendering in ie8. I've allready tried clearing the cache, and I'm also sending the correct filetypes if I'm not mistaken. What am I missing here?

@font-face {
font-family: 'Lobster';
src: url('fonts/lobster.eot');
src: url('fonts/lobster.eot') format('embedded-opentype'),
     url('fonts/lobster.woff') format('woff'),
     url('fonts/lobster.ttf') format('truetype'),
     url('fonts/lobster.svg#Lobster1.4Regular') format('svg');
}

.logoHome{color:#FFF; font: 58px Lobster, serif; text-decoration:none; line-height:58px;}

回答1:


the problem it is easy solve, just make the url path to be relative:

 @font-face {
    font-family: 'Lobster';
    src: url('http://www.sample.com/fonts/lobster.eot');
    src: url('http://www.sample.com/fonts/lobster.eot?#iefix') format('embedded-opentype'),
         url('http://www.sample.com/fonts/lobster.woff') format('woff'),
         url('http://www.sample.com/fonts/lobster.ttf') format('truetype'),
         url('http://www.sample.com/fonts/lobster.svg#Lobster13Regular') format('svg');
    font-weight: normal;
    font-style: normal;

}

but this will only work down to IE8 you can use this caniuse.com to always check which thing you can use in older browsers




回答2:


The first line gave an error. Removing:

src: url('fonts/lobster.eot');

Did the trick.



来源:https://stackoverflow.com/questions/17463892/custom-fonts-not-working-in-ie-8-and-below

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!