简体   繁体   English

与fontawesome的@ font-font问题

[英]@font-font issue with fontawesome

I am having issues with my fontawesome … 我的遗嘱有问题......

font-awesome.css 字体awesome.css

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.0.3');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), 
  url('../fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), 
  url('../fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), 
  url('../fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

the issue is that my icons are not loading I have try www.example/com/font/fontawesome-webfont.eot and the file get downloaded which means that the link works 问题是我的图标没有加载我已经尝试www.example/com/font/fontawesome-webfont.eot并且文件被下载,这意味着链接有效

in my head.php file I am calling font-awesome.css which is in my css folder like this 在我的head.php文件中,我正在调用font-awesome.css ,这是在我的css文件夹中

<link rel="stylesheet" href="<?php echo $directories->fetchdir($css); ?>/font-awesome.css">

this is the same way I am calling all my js and image folder and this works fine. 这与我调用所有js和图像文件夹的方式相同,这很好用。

in my index.php file I am calling the head.php like this 在我的index.php文件中,我这样调用head.php

<?php include_once ("views/head.php"); ?>

The reason why I am showing all this is because might this be a reason why my `fontawesome-webfont.eot are not showing? 我之所以展示这一切的原因是因为这可能是我的`fontawesome-webfont.eot没有显示的原因吗? or is it another reason? 还是另一个原因?

在此输入图像描述

Please help 请帮忙

Hardcode your fontawesome URL to test if it works? 硬编码您的fontawesome URL以测试它是否有效? If it works, then try to remove ".." from css 如果它有效,那么尝试从css中删除“..”

@font-face {
  font-family: 'FontAwesome';
  src: url('/fonts/fontawesome-webfont.eot?v=4.0.3');
  src: url('/fonts/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), 
  url('/fonts/fontawesome-webfont.woff?v=4.0.3') format('woff'), 
  url('/fonts/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), 
  url('/fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

You'll have to work on the rendered mark-up and then fix your fontawesome path: It will be helpful to see where is your CSS relevant to your "/fonts/fontawesome-webfont.eot" down-loadable file. 你将不得不处理渲染的标记,然后修复你的fontawesome路径:看看你的CSS与你的“/fonts/fontawesome-webfont.eot”可下载文件相关的位置会很有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM