Html 如何在 css 中使用 arial 窄?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21231467/
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 00:35:33  来源:igfitidea点击:

How can I use arial narrow in css?

htmlcssfonts

提问by Ichvan Ibragimov

#main{
margin-left: auto;
margin-right: auto;
margin-top: 0;   
font-family: "Arial Narrow";
position: absolute;
font-size: 10pt;
}

this is a part of my css-code, where I want to use arial narrow

这是我的 css 代码的一部分,我想在其中使用 arial 窄

回答by Guffa

You use it just like that. The user that views the page has to have the font installed, otherwise the browser will choose a different font.

你就这样使用它。查看页面的用户必须安装该字体,否则浏览器将选择不同的字体。

You may want to specify fallbacks for those who don't have that font, for example:

您可能希望为那些没有该字体的人指定回退,例如:

font-family: "Arial Narrow", Arial, sans-serif;

回答by Jocó Bodó

There is a bug with Firefox not recognizing Arial Narrow.

Firefox 存在无法识别 Arial Narrow 的错误。

I use the CSS3 "font-stretch" property, and it works fine.

我使用 CSS3“font-stretch”属性,它工作正常。

body{
font: 13px 'Arial Narrow', Arial, sans-serif; 
font-stretch: condensed;
}

回答by neel

change like

改变像

font-family: "Arial Narrow", Arial, sans-serif;

回答by immayankmodi

try this it should work:

试试这个它应该工作:

#main{
margin-left: auto;
margin-right: auto;
margin-top: 0;   
font-family: "Arial Narrow", Arial, sans-serif;
position: absolute;
font-size: 10pt;
}

reference it from here: http://cssfontstack.com/

从这里引用它:http: //cssfontstack.com/

Note: also you must need to download and install that font on server or project where ever you using or you can also give reference to it.

注意:您还必须在您使用的服务器或项目上下载并安装该字体,或者您也可以参考它。