我有一个网页,我使用的"font-family: Poppins-Medium;"在我的个人电脑,字体是正确的显示。然而,在其他电脑中,只显示"Times“字体。谁能帮我个忙?
参见CSS代码:
.txt2 {
font-family: Poppins-Regular;
font-size: 14px;
color: #999999;
line-height: 1.5;
}谢谢。
PS:这是到页面的链接:http://ez2main.somee.com/estock/cliadd.asp
发布于 2020-02-13 22:51:55
我建议使用网页安全字体代替。
发布于 2020-02-13 22:59:10
为了使用自定义字体,您应该首先声明@字体。所有这些都写在这个链接上,但让我总结一下:
步骤1:将字体文件上载到服务器
步骤2:声明字体名称并使用src属性链接这些文件。
步骤3:现在,自定义字体将显示在每个浏览器上,因为它们在服务器上可用。
希望这能帮上忙!
发布于 2020-02-13 23:13:21
当这种情况发生在我身上时,是因为我在电脑上安装了字体,而在服务器上却没有。在使用之前,请确保使用@font-face设置您的自定义字体。
@font-face { font-family: 'Poppins-Regular'; src: url('../font/Poppins-Regular.eot'); /* IE9 Compat Modes */ src: url('../font/Poppins-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('../font/Poppins-Regular.woff2') format('woff2'), /* Super Modern Browsers */ url('../font/Poppins-Regular.woff') format('woff'), /* Modern Browsers */ url('../font/Poppins-Regular.ttf') format('truetype'), /* Safari, Android, iOS */ }
还要确保添加适当的后退字体,以使它更优雅地失败。
font-family: Poppins-Regular, 'second-closest-font', Arial, etc;
https://stackoverflow.com/questions/60217606
复制相似问题