Html 如何设置 Helvetica 字体?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17616531/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 11:03:23  来源:igfitidea点击:

How to set Helvetica font?

htmlcssmozilla

提问by Mediator

How to set Helvetica font?

如何设置 Helvetica 字体?

I add css:

我添加CSS:

body
{
    font-family: Helvetica, Sans-Serif;
    color: #444444;
    font-size: 9pt;
    background-color: #FAFAFA;
}

but in Mozilla I see MS shell dlgfont.

但在 Mozilla 中,我看到了MS shell dlg字体。

Why is this happens and how will repair it? enter image description here

为什么会发生这种情况以及如何修复它? 在此处输入图片说明

Update:

更新:

I set Arial but in Mozilla I see MS shell dlgagain.enter image description here

我设置了 Arial,但在 Mozilla 中我又看到MS shell dlg了。在此处输入图片说明

回答by Mr Lister

If you want all browsers to use Arial whenever Helvetica is not available, you can always specify Arial as a second choice font.

如果您希望所有浏览器在 Helvetica 不可用时使用 Arial,您始终可以将 Arial 指定为第二选择字体。

body
{
    font-family: 'Helvetica', 'Arial', sans-serif;
    color: #444444;
    font-size: 9pt;
    background-color: #FAFAFA;
}

because font-familycan use any number or arguments, and it will use the first one in the list that is available.

因为font-family可以使用任何数字或参数,并且它将使用列表中可用的第一个。