相同的字体在 FF7 和 Chrome 中呈现不同的效果
截图:https://i.sstatic.net/ACTqz.png
非常明显我的网站在我的 Win7 机器上的 Chrome 和 FF7 上呈现不同,
我正在使用这个:
h1, h2 {font-family: "Lucida Grande", "Helvetica Neue", Arial; }
有人能指出我如何才能均匀这些差异吗?我不希望每个浏览器上的字体都有不同的“感觉”。
字体 Lucida Grande 安装在我的 Windows 机器中
编辑: font-weight: 正常 !important
也不起作用
Screenshot: https://i.sstatic.net/ACTqz.png
It is pretty evident that my site renders different on Chrome and FF7 on my Win7 machine
I am using this:
h1, h2 {font-family: "Lucida Grande", "Helvetica Neue", Arial; }
Does anybody can point me how can I even these diffs? I don't want fonts with different 'feelings' on each browser.
The font, Lucida Grande is installed in my Windows machine
EDIT:
font-weight: normal !important
doesn't work either
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来两个浏览器正在使用不同的权重来渲染它。
我可以想到两种可能性,尽管我不知道哪种方法是正确的。
您请求使用粗体字体,但该字体不提供粗体。一个浏览器仅显示未更改的常规非粗体变体,而另一个浏览器已将其处理为粗体。
您请求了特定的字体粗细,例如“粗体”或“600”,但安装的字体与该粗细不完全匹配。一个浏览器正在替换字体的“超粗体”变体,而另一个浏览器则替换为“常规粗体”或类似性质的字体。
如果其中任何一个是正确的,您可以使用 font-weight CSS 属性 尝试改变它。但是,如果在根本没有 Lucida Grande 字体的系统上查看该字体,这可能会影响所选字体的替换。
It looks like the two browsers are rendering it with a different weight.
I can think of two possibilities, though I don't know if either are correct.
You requested a bold font, but that font is not available in bold. One browser is just showing the regular, non-bold variant unchanged, whereas the other has processed it to look bold.
You requested a particular weight of font, say "bold" or "600" but the installed fonts do not precisely match that weighting. One browser is substituting an "extra-bold" variant of font, and the other a "regular-bold", or something of this nature.
If either of these is correct you could play around with the font-weight CSS property to try and alter it. But then that may affect substitution of whichever font is chosen in the case that it is viewed on a system with no Lucida Grande font at all.
字体在不同浏览器之间的呈现总是略有不同,但这比平常的差异更大一些。可能是因为标题默认为
font-weight:bold;
,并且字体没有粗体变体,因此浏览器以不同的方式从常规粗细创建粗体样式。无论如何,您可能想使用更常见的字体。在我的 Windows 7 计算机上,既没有 Lucida Grande 也没有 Helvetica Neue,因此它将使用 Arial 进行渲染。尽管如此,我还是有 MS Office 和 Photoshop 附带的附加字体,因此我安装的字体比标准系统中的字体要多得多。
另外,您应该始终指定通用字体作为最后的手段,在本例中为
sans serif
,否则如果未安装任何字体,它将使用默认字体进行渲染,类似于Times Roman
具有完全不同的外观。或许还可以添加Helvetica
,它是非 Windows 系统上与Arial
最接近的等效项。Fonts will always render slightly different from one browser to another, but that was a bit more difference than usual. Probably because the headers have
font-weight: bold;
as default, and the font doesn't have a bold variation so the browsers create the bold style from the regular weight in different ways.Anyway, you might want to use more common fonts. On my Windows 7 machine there is neither Lucida Grande nor Helvetica Neue, so it would render using Arial. Still, I have the additional fonts that come with both MS Office and Photoshop, so I have a lot more fonts installed than you can expect from a standard system.
Also, you should always specify a generic font as the last resort, in this case
sans serif
, otherwise it would render using the default font if none of the fonts are installed, which is something likeTimes Roman
which has a completely different look. Perhaps also addingHelvetica
, which is the closest equivalent ofArial
on non-Windows systems.