0

我正在建立一个 WordPress 网站。我选择菜单栏的字体。但问题是,这个字体只显示谷歌浏览器,它不显示在 IE 和 Mozilla (FireFox) 中。

请帮我

这是我的字体

#nav ul li a:hover, 
#nav .current-menu-item > a, 
#nav .current-menu-ancestor > a,
div#nav ul .current_page_item > a {
   color: #9A6614;
}

#nav > ul li, 
#nav .menu > ul li {
  padding: 8px 0;
}

#nav > ul li a,
#nav .menu > ul li a {
  padding: 0 25px 0 25px;
  font-size:17px;
  border-left: 1px solid #CFCFCF;
  font-family:"LovePotionNo10Bold" !important;
}

#nav ul li:first-child a{
  font-family:LovePotionNo10Bold !important;
  border-left: 0px;
}

下面是我的头文件声明

@font-face {
font-family: 'LovePotionNo10';src: url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_0_0.eot');
src: url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_0_0.eot?   #iefix') format('embedded-opentype'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_0_0.woff') format('woff'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_0_0.ttf') format('truetype');
}

@font-face {
font-family: 'LovePotionNo10Bold';
src: url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_1_0.eot');
src: url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_1_0.eot?#iefix') format('embedded-opentype'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_1_0.woff') format('woff'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_1_0.ttf') format('truetype');
}

@font-face {
font-family: 'LovePotionNoOrnaments';
src: url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_2_0.eot');
src: url('webfonts/22418E_2_0.eot?#iefix') format('embedded-opentype'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_2_0.woff') format('woff'),
url('http://comidaslacocotte.com/wp-content/themes/maya/webfonts/22418E_2_0.ttf') format('truetype');
}
4

2 回答 2

1

我在您的代码中看到一个错字,不知道它是否能解决您的问题:

#nav ul li:first-child a{
  font-family: 'LovePotionNo10Bold' !important;
  border-left: 0px;
}

需要在字体声明、单打或双打周围加上引号。

仅供参考:我建议放弃 !important 规则。

于 2012-10-11T07:34:53.327 回答
1

阅读这篇文章: http: //paulirish.com/2009/bulletproof-font-face-implementation-syntax/

对于任何使用@font-face. 建议的语法是:

@font-face {
  font-family: 'Graublau Web';
  src: url('GraublauWeb.eot?') format('eot'), 
       url('GraublauWeb.woff') format('woff'), 
       url('GraublauWeb.ttf') format('truetype');
}
于 2012-10-11T07:36:36.347 回答