【发布时间】:2015-10-11 03:27:24
【问题描述】:
我正在使用 @font-face 函数在我的 Wordpress 网站上使用自定义字体 (Geosanslight)。
我已经使用http://www.fontsquirrel.com 下载了webkit 并将它们上传到文件夹http://www.lynnepassmore.com/public_html/wp-content/themes/esteem/fonts。
然后我在我的自定义 css 文件中使用了 @font-face 函数来调用它们。但是该字体在任何浏览器上均不可见。
这是我的@font-face css:
@font-face {
font-family: 'geosanslight';
src: url('../fonts/geosanslight-webfont.eot');
src: url('../fonts/geosanslight-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/geosanslight-webfont.woff2') format('woff2'),
url('../fonts/geosanslight-webfont.woff') format('woff'),
url('../fonts/geosanslight-webfont.ttf') format('truetype'),
url('../fonts/geosanslight-webfont.svg') format('svg');
font-weight: normal;
font-style: normal;
}
body, h1, h2, h3, h4, h5, h6, p, li, a {
font-family: geosanslight !important;
}
【问题讨论】:
-
你在哪里添加了
@font-faceCSS? -
嗨,Zaq,你有一个指向你网站的链接,你的字体路径可能是错误的
-
进入主题选项下的自定义css文件
-
www.lynnepassmore.com
-
您的样式正在输出到您的
index.php文件,请使用绝对路径指向您的字体文件。
标签: css wordpress fonts font-face custom-font