我在我的WordPress站点上安装了一个来自myfonts.com的网页字体。我更新了CSS如下:
@import url("../bridge/style.css");
/* LICENSE HERE */
@import url("//hello.myfonts.net/count/xxxxxxx");
@font-face {
font-family: "VeneerTwo";
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.eot');
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.eot?#iefix') format('embedded-opentype');
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.woff2') format('woff2');
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.woff') format('woff');
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.ttf') format('truetype');
src: url('http://www.example.com/wordpress/webfonts/xxxxxx_0_0.svg#wf') format('svg');
}
h1, h2, h3, h4, h5 { font-family: "VeneerTwo" !important; }
所有字体都存在于web服务器上。
当我在开发人员工具中检查网站时,我看到H2元素的样式为VeneerTwo
:
h1, h2, h3, h4, h5 {
font-family: "VeneerTwo" !important;
}
不幸的是,h2
元素的字体只是默认的(Times New Roman,如果我没弄错的话)。
有谁知道为什么VeneerTwo字体不显示,如何修复?
在导入其他媒体或css之前,尝试先放入@font-face。
但是您告诉字体显示在开发人员工具上,请尝试清除缓存并再试一次。比如按两次ctrl+f5
我想添加以下内容:受@arkascha建议检查访问日志的激励,我只是用我身边的旧iphone (iphone 4)检查了一下。是的,在iphone 4上显示了字体。