简体   繁体   English

CSS字体松鼠不能正确应用

[英]CSS font squirrel not applying properly

I am using two fonts from font squirrel for this practice to style some of the my wordpress widget areas:Gothic and Playfair Display. 我使用松鼠字体中的两种字体来为某些wordpress小部件区域设置样式:Gothic和Playfair Display。 But for some reason,only Playfair is being applyed and Gothic is being ignored. 但是由于某种原因,仅应用Playfair,而忽略了哥特式。 Because its wordpress widget areas I cant actually display the html but basically the following is the CSS code which again works for one type font only: 因为它的wordpress小部件区域我实际上无法显示html,但是基本上,以下是CSS代码,该代码再次仅适用于一种字体:

CSS: CSS:

@font-face{
  font-family: 'Playdisplay';
  src: url('font/PlayfairDisplay-Bold.ttf') format('ttf'),
     url('font/PlayfairDisplay-BlackItalic.ttf') format('ttf'),
     url('font/PlayfairDisplay-BoldItalic.ttf') format('ttf'),
     url('font/PlayfairDisplay-Italic.ttf') format('ttf'),
     url('PlayfairDisplay-Regular.ttf') format('ttf'),
     url('font/PlayfairDisplay-black.ttf') format('ttf');
 font-weight: normal;
 font-style: normal;     
}
@font-face{
   font-family: 'Goth';
   src: url('font/GOTHIC.ttf') format('ttf'),
      url('font/GOTHICB.ttf') format('ttf'),
      url('font/GOTHICBI.ttf') format('ttf'),
      url('font/GOTHICI.ttf') format('ttf');
  font-weight: normal;
  font-style: normal; 
}

.mainfooter h3{
  font-family: Goth, GOTHIC; 
}

footer h1,
footer h2,
footer h3{
  font-family: Playdisplay, PlayfairDisplay-Bold;
}

How can I use both fonts and apply anywhere in the site? 如何使用两种字体并在网站的任何位置应用?

Try placing your font names in single quotes 尝试将字体名称放在单引号中

.mainfooter h3{
  font-family: 'Goth'; 
}

footer h1,
footer h2,
footer h3{
  font-family: 'Playdisplay';
}

Also, you're using relative paths for your font files, check these are correct! 另外,您正在使用字体文件的相对路径,请检查它们是否正确!

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

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