CSS无法识别“下一个Avenir"作为我的字体家族 [英] CSS Not Recognizing "Avenir Next" as my font family

查看:56
本文介绍了CSS无法识别“下一个Avenir"作为我的字体家族的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将CSS用作标题,所有菜单都应以"Avenir Next"字体系列的形式出现.但是它没有意识到这一点.它显示为简单的Arial.

I am using CSS for my headers where all menus should be coming as "Avenir Next" font-family. But it is not recognizing it. It is showing as simple 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; 
}

这是因为" 字体名称中存在空格.

It is because of " " Space in font name.

通过查看您的最后一条评论,建议您将 font-file 托管在 .ttf .ote 中或 .otf 格式,然后在页面中链接该文件.

By Looking at your last comment, I'll suggest you to host a font-file in either a .ttf, .ote or .otf format and link that file in your page.

并使用以下代码:

@font-face {
  font-family: 'Avenir Next';
  src: url("http://www.yoursite.com/fonts/Avenir_Next.otf"); /* File to be stored at your site */
  }

即使您的客户端计算机上未安装字体,这也将为您提供帮助.

That will help you even if your font is not installed at your clients computer.

希望它会为您提供帮助.欢呼:)!

Hope it'll help you. cheers :)!

这篇关于CSS无法识别“下一个Avenir"作为我的字体家族的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆