@ Font-face在手机上不起作用 [英] @Font-face not working on mobile

查看:509
本文介绍了@ Font-face在手机上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码,它可以在台式机和平板电脑上完美运行,但不能在移动设备上运行.是代码还是在移动设备上无法正常使用某些字体

Here's my code it works perfectly fine on desktop and tablet but not on mobile. Is it the code or do some fonts just not work on mobile

@font-face {
    font-family: 'Out';
    src: url('http://location/Outstanding.otf');
}

推荐答案

您需要将所有src所需的所有内容添加到@font-face中,例如以下示例:

You need to add all src needed to @font-face like this example:

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

来源: https://css -tricks.com/snippets/css/using-font-face/
希望能帮助到你, 欢呼.

Source: https://css-tricks.com/snippets/css/using-font-face/
Hope it helps, cheers.

(如果需要转换字体,则需要此 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆