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
How to set Helvetica font?
提问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 dlg
font.
但在 Mozilla 中,我看到了MS shell dlg
字体。
Why is this happens and how will repair it?
为什么会发生这种情况以及如何修复它?
Update:
更新:
I set Arial but in Mozilla I see MS shell dlg
again.
我设置了 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-family
can use any number or arguments, and it will use the first one in the list that is available.
因为font-family
可以使用任何数字或参数,并且它将使用列表中可用的第一个。