简体   繁体   English

CSS @ font-face无法呈现

[英]CSS @font-face doesn't render

I'm using the following code in the style sheet for my website, but it won't render when I run it in the browser, the font doesn't render. 我在网站的样式表中使用以下代码,但是当我在浏览器中运行它时,它将不会呈现,字体也不会呈现。 What am I doing wrong? 我究竟做错了什么?

@font-face {  
  font-family: 'Libel Suit';  
  src: url('my.ip.n.n/~/wordpress/fonts/libelsuit.woff') format('woff'),  
       url('my.ip.n.n/~/wordpress/fonts/libelsuit.ttf') format('truetype');  
       // These aren't the exact URLS I'm using, since I don't want the  
       // world to know my ip address
}

Check your network panel to determine if the fonts are actually being loaded: 检查您的网络面板,以确定是否真正加载了字体:

在此处输入图片说明

If they are, ensure you are correctly referencing them in your css, eg: 如果是,请确保您在CSS中正确引用了它们,例如:

h1 {
  font-family: 'Libel Suit'; 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM