【问题标题】:Wordpress: external Font doesn't show in FrontendWordpress:外部字体不显示在前端
【发布时间】:2018-10-17 18:21:09
【问题描述】:

我试图用以下代码在 Wordpress 中包含一个外部字体,但它不起作用:

@font-face {
  font-family: 'Splatoon';
  src: url('http://paperyoshi.at/font/Splatoon/Splatoon.eot?#iefix') format('embedded-opentype'),
       url('http://paperyoshi.at/font/Splatoon/Splatoon.woff') format('woff'),
       url('http://paperyoshi.at/font/Splatoon/Splatoon.woff2') format('woff2'),
       url('http://paperyoshi.at/font/Splatoon/Splatoon.ttf')  format('truetype'),
       url('http://paperyoshi.at/font/Splatoon/Splatoon.svg#svgFontName') format('svg');
}

body {
    font-family: Splatoon;
}

【问题讨论】:

  • 你试过font-family: 'Splatoon' !important吗?
  • @Gaspacchio 我试过了,但是非常感谢
  • 在字体名称周围使用引号?也许(我知道这不是一个真正的好方法),它可以使用* 选择器工作?
  • 控制台是否显示任何错误?
  • 现在它工作了,我们将字体重新加载到 webspace。非常感谢您的支持。

标签: wordpress css font-face webfonts


【解决方案1】:

试试!importanttag,例如把它放在css行后面 font-family: Arial !important;

【讨论】:

    【解决方案2】:

    如果plih1h6 等其他标签具有特定的字体系列设置,则body 的字体设置几乎不会生效。检查您的主题样式表以查看这些标签是否有字体定义,如果有,请创建覆盖这些的特定 CSS 规则。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-16
      • 2013-12-15
      • 2018-10-04
      • 1970-01-01
      • 1970-01-01
      • 2013-04-15
      • 1970-01-01
      相关资源
      最近更新 更多