3
我在下面有這個字體的臉部代碼,它在谷歌瀏覽器中工作正常,但它在Firefox中完全不起作用?爲什麼?CSS font-face在Firefox中不工作
<style type="text/css">
@font-face {
font-family: 'Lato';
src: url('http://www.website.com/fonts/ca/Lato-Reg-webfont.eot');
src: url('http://www.website.com/fonts/ca/Lato-Reg.ttf') format('truetype'),
url('http://www.website.com/fonts/ca/Lato-Reg-webfont.eot?#iefix') format('embedded-opentype'),
url('http://www.website.com/fonts/ca/Lato-Reg-webfont.woff') format('woff'),
url('http://www.website.com/fonts/ca/Lato-Reg-webfont.svg#LatoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'LatoBold';
src: url('http://www.website.com/fonts/ca/Lato-Bol-webfont.eot');
src: url('http://www.website.com/fonts/ca/Lato-Bol.ttf') format('truetype'),
url('http://www.website.com/fonts/ca/Lato-Bol-webfont.eot?#iefix') format('embedded-opentype'),
url('http://www.website.com/fonts/ca/Lato-Bol-webfont.woff') format('woff'),
url('http://www.website.com/fonts/ca/Lato-Bol-webfont.svg#LatoBold') format('svg');
font-weight: normal;
font-style: normal;
}
nav ul li{
font-family: 'LatoBold', sans-serif !important;
}
</style>
<nav id="mainNav">
<ul class="grid_0">
<li>
<a href="http://www.website.com">Home</a>
</li></ul>
這應該可以幫助你http://stackoverflow.com/questions/2856502/css-font-face-not-working-with- firefox-but-working-with-chrome-and-ie – Jules
找不到字體文件,例如http://www.website.com/fonts/ca/Lato-Bol-webfont.woff會產生一個HTML響應。可能你有其他的代碼服務於其他瀏覽器的魔法。 ☺ –