gpt4 book ai didi

html - html (firefox) 中的文本显示在 ubuntu 和 windows 7 中显示不同,为什么?

转载 作者:行者123 更新时间:2023-11-28 03:22:47 24 4
gpt4 key购买 nike

Windows 中 Firefox 的 html+css 看起来不错,但在 Ubuntu 中的 Firefox 中看起来同样不合适。请让我知道,至于如何纠正,我该怎么办?

更多信息 1:所附图片中文本的 css 代码:

style="font-family:'Museo 300'; 
font-size:11px;
text-align:left;
color:#636466;
padding-top:3px;"

虽然正在将 Museo 300 字体更改为 Arial, Helvetica, sans-serif,因此它可以在任何浏览器中加载这些默认字体,但我仍然看到这个问题。

附上图片

Windows 7 - firefox Ubuntu - firefox

最佳答案

很可能您正在使用的字体没有安装在 Ubuntu 机器上。要解决这个问题,您必须自己提供字体。 Google Fonts是做到这一点的好方法。

您可以在他们的网站上搜索合适的字体,然后将其链接到您的网站<head> .

<link href='http://fonts.googleapis.com/css?family=Roboto:300' rel='stylesheet' type='text/css'>

然后在你的CSS中使用它

font-family: 'Roboto', sans-serif;

遗憾的是,Google Fonts 没有您尝试使用的 Museo 字体。但是,您可以使用 @font-face CSS At-Rule 链接到您在网站上托管的字体文件。确保您只托管您计划使用的语言和字体粗细/样式,并且您的字体文件仅限于那些相同的参数。这将使文件加载速度更快。

@font-face {
font-family: 'My Custom Font';
src: url('http://yoursite.com/yourfontfile.ttf') format('truetype');
}
p.customfont {
font-family: 'My Custom Font', Verdana, Tahoma;
}

( See this answer for more information )

关于html - html (firefox) 中的文本显示在 ubuntu 和 windows 7 中显示不同,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23336112/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com