<分区>
我在标题中使用 CSS,其中所有菜单都应作为“Avenir Next”字体系列出现。但它不承认它。它显示为简单的 Arial。
我的代码是:
#main .Header .mainnav ul {
float: left;
list-style: none;
margin: -17px 0 0;
padding: 0;
font-family: Avenir Next !important;
font-size: 14px;
}
<分区>
我在标题中使用 CSS,其中所有菜单都应作为“Avenir Next”字体系列出现。但它不承认它。它显示为简单的 Arial。
我的代码是:
#main .Header .mainnav ul {
float: left;
list-style: none;
margin: -17px 0 0;
padding: 0;
font-family: Avenir Next !important;
font-size: 14px;
}
最佳答案
尝试:
#main .Header .mainnav ul {
float: left;
list-style: none;
margin: -17px 0 0;
padding: 0;
font-family: "Avenir Next" !important;
font-size: 14px;
}
这是因为 ""
字体名称中的空格。
通过查看您最后的评论,我建议您以 .ttf
、.ote
格式托管一个 font-file
或 .otf
格式并在您的页面中链接该文件。
并使用这段代码:
@font-face {
font-family: 'Avenir Next';
src: url("http://www.yoursite.com/fonts/Avenir_Next.otf"); /* File to be stored at your site */
}
即使您的字体没有安装在您的客户端计算机上,这也会对您有所帮助。
希望对您有所帮助。干杯 :)!
关于html - CSS 无法将 "Avenir Next"识别为我的字体系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23754655/