Fonts not rendering uniformly in browsers

前端 未结 4 1884
暖寄归人
暖寄归人 2020-12-22 04:30

I am trying to use custom fonts on my website and in the css I have the following code:

@font-face {
    font-family: \'Sketch\';
    src: url(\'../fonts/Ske         


        
4条回答
  •  忘掉有多难
    2020-12-22 05:20

    Different browsers supports different font formats:

    Font formats

    So you need to create your font in all formats. You can use Font Squirrel (thank you, effectica).

    And then, you can import them like that:

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

    That's not the only possible way. You can find more complete information on this question at Paul Irish's blog.

    And, anyway, their appearance may differ a little in different browsers.

提交回复
热议问题