这是我的代码,它在台式机和平板电脑上运行良好,但在移动设备上运行不佳。是代码还是做一些字体在移动设备上不起作用
@font-face {
font-family: 'Out';
src: url('http://location/Outstanding.otf');
}
最佳答案
您需要将所有需要的 src
添加到 @font-face
中,就像这个例子:
@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/
希望能帮助到你,
干杯。
(如果你需要转换字体,你需要这个 font-generator )
关于html - @Font-face 不能在手机上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43327227/