什么是字体定义的最小CSS3兼容性规则?

时间:2012-08-15 14:49:06

标签: css3 fonts svg true-type-fonts eot

  

可能重复:
  How we can use @font-face in LESS type of CSS

现代浏览器及其最新版本在我们的脑海中(对于将来使用的网站),使用ttf,svg和eot的这种字体定义是FF,IE,Chrome和Safari的最佳解决方案吗? / p>

以下是保证兼容性的最佳最小版本吗?换句话说,现在可以删除svg和eot,还是IE仍然需要eot无法读取ttf?

        @font-face {
            font-family: 'Somefont Regular';
            src: url('somefont.eot');
            src: local('Somefont Regular'), 
                 local('Somefont'), 
                 url('somefont.ttf') format('truetype'),
                 url('somefont.svg#font') format('svg'); 

1 个答案:

答案 0 :(得分:2)

神奇的保罗爱尔兰人在2010年的某个时候撰写了一篇关于@font-face跨浏览器/跨平台支持的文章。It's worth checking out.

此外,这里有一些我经常使用的代码:

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