2016-02-27 136 views
3

该字体适用于w3schools网站,但不适用于我的网页和jsfiddle。字体不能正常工作

jsfiddle example

HTML

<div> 
With CSS3, websites can finally use fonts other than the pre-selected "web-safe" fonts. 
</div> 

CSS

@font-face { 
    font-family: "Penultimate"; 
    src: url("http://db.onlinewebfonts.com/t/17a456c0eb7e6bd88cb1d090126915f7.eot"); 
    src: url("http://db.onlinewebfonts.com/t/17a456c0eb7e6bd88cb1d090126915f7.eot?#iefix") format("embedded-opentype"), 
    url("http://db.onlinewebfonts.com/t/17a456c0eb7e6bd88cb1d090126915f7.woff") format("woff"), 
    url("http://db.onlinewebfonts.com/t/17a456c0eb7e6bd88cb1d090126915f7.ttf") format("truetype"), 
    url("http://db.onlinewebfonts.com/t/17a456c0eb7e6bd88cb1d090126915f7.svg#Penultimate") format("svg"); 
} 

div { 
    font-family: Penultimate; 
} 
+1

你的代码是在这里工作(一对后,不是的jsfiddle)。 –

+0

它不在jsfiddle上工作,因为字体没有通过https加载,所以为了安全而被阻止。只需打开控制台。如果你可以分享你的网页 – sniels

回答

3

的jsfiddle使用HTTPS,因此浏览器加载阻止出于安全原因的字体。您将在浏览器控制台中看到错误。

Errors in console

火狐允许您通过点击地址栏中的证书部分暂时忽略错误。

working fonts

+0

谢谢@Jan Tojnar! – mac