@font-face - how to make it work on all browsers

前端 未结 4 1923
后悔当初
后悔当初 2020-12-06 07:58

The @font-face rule is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.

However, Internet Explorer 9 only supports .eot typ

4条回答
  •  甜味超标
    2020-12-06 08:39

    @font-face {
      font-family: 'Awesome Font';
      font-style: normal;
      font-weight: 400;
      src: local('Awesome Font'),
           url('/fonts/awesome.woff2') format('woff2'), 
           url('/fonts/awesome.woff') format('woff'),
           url('/fonts/awesome.ttf') format('truetype'),
           url('/fonts/awesome.eot') format('embedded-opentype');
    }
    

    The local() directive allows you to reference, load, and use locally installed fonts.

    The url() directive allows you to load external fonts, and are allowed to contain an optional format() hint

提交回复
热议问题