gpt4 book ai didi

html - 字体在 chrome/firefox 中显示不同

转载 作者:行者123 更新时间:2023-11-28 12:41:47 27 4
gpt4 key购买 nike

每一个。

我在不同浏览器中显示我的页面时遇到问题。这里我使用的是“Myrid Set Pro”字体。

我在 chrome 中得到了正确的结果。但不是在火狐中。我附上了这些文件。

Part of Website in Chrome Look Like this

Part Of Website in Firefox Look Like this

这里第一个是在 Chrome 中预览。第二个是在 Firefox 中预览。

我也试过文本渲染。但是没用

text-rendering: optimizelegibility;

最佳答案

目前,关于这个话题还没有达成共识。可耻的是,有很多技巧,但没有针对此问题的具体解决方案。

问题是,每个浏览器和操作系统处理字体呈现的方式不同。这就是为什么很难跨 Web 浏览器和系统获得相同结果的原因。

同样的问题在 SO 上被问过几次:

1.- How do I get font to display properly in all browsers?

2.- Same font yet its weight seems different on different browsers

下面,我将列出一些建议的解决方案;但是它们可能不起作用:

// @Mohamed Anis Dahmani
html, html a {
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0,0,0,0.004);
}

// @oneiota
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;

还有一个使用 translate3d 的:webfont-rendering-fix.css

body {
-webkit-transform: translate3d(0px, 0px, 0px); /* Force hardware acceleration to fix safari opacity bugg*/
}

我的建议是寻找网络安全字体 http://cssfontstack.com/这将最大限度地减少跨网络浏览器和操作系统的字体呈现的影响。

关于html - 字体在 chrome/firefox 中显示不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26352852/

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