html - 自定义字体不适用于 webkit 浏览器

标签 html css font-face webfonts

谁能帮我解决这个问题: 我有这个字体:

@font-face {
    font-family: 'Museo500Regular';
    src: url('MuseoSans_500-webfont.eot');
    src: local('?'), 
    url('MuseoSans_500-webfont.woff') format('woff'), 
    url('MuseoSans_500-webfont.ttf') format('truetype'), 
    url('MuseoSans_500-webfont.svg#webfontr3rD8cn7') format('svg');
    font-weight: normal;
    font-style: normal;
}

这在 webkit 浏览器上不起作用,我不明白为什么...... O 其他浏览器,如 firefox 或 IE,它工作得很好,但仅在 webkit 上呈现效果不佳。

这里有一个带有下拉菜单的测试页面示例,只需查看其他浏览器和谷歌浏览器上的字体即可。

http://mainpage.ueuo.com/

谢谢。

最佳答案

我已经下载了你的 MuseoSans_500-webfont.ttf.. 看起来它不是一个有效的字体......或者没有正确上传到服务器......再次上传......

或者转到以下链接并生成您的字体样式 css... http://www.fontsquirrel.com/fontface/generator

@font-face {
    font-family: 'Museo500Regular';
    src: url('museosans_500-webfont-webfont.eot');
    src: url('museosans_500-webfont-webfont.eot?#iefix') format('embedded-opentype'),
         url('museosans_500-webfont-webfont.woff') format('woff'),
         url('museosans_500-webfont-webfont.ttf') format('truetype'),
         url('museosans_500-webfont-webfont.svg#_.regular') format('svg');
    font-weight: normal;
    font-style: normal;

}

关于html - 自定义字体不适用于 webkit 浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13067061/

相关文章:

html - 响应式图像 Bootstrap

javascript - 将类添加到发生碰撞的 div

html - 有人可以解释如何安装 SoundManager2

html - css div 背景图片出现在顶部菜单之前

.htaccess - 如何解决 'Missing Cross-Origin Resource Sharing (CORS) Response Header' webfont 问题?

javascript - jQuery:是焦点元素吗?

python - 我可以在 XPath 中访问父级的子级吗?

CSS 'absolute' 定位 : what is the behavior when there is no non-static ancestor?

css - 使用@font-face 在 IE 中闪烁无样式的内容

html - 我可以使用哪些字体?