【问题标题】:What is the minimal CSS3 compatibility rule for font definition? [duplicate]字体定义的最小 CSS3 兼容性规则是什么? [复制]
【发布时间】:2023-03-19 22:30:01
【问题描述】:

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

考虑到现代浏览器及其最新版本(对于打算供将来使用的网站),这种带有 ttf、svg 和 eot 的字体定义是否会成为 FF、IE、Chrome 和 Safari 的最佳解决方案?

以下是保证兼容性的最佳最小版本吗?换句话说,现在可以删除 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'); 

【问题讨论】:

    标签: css fonts svg truetype eot


    【解决方案1】:

    神奇的 Paul Irish 在 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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-20
      • 2013-02-05
      • 1970-01-01
      • 2013-03-28
      相关资源
      最近更新 更多