【发布时间】:2013-11-12 17:06:24
【问题描述】:
您好,我是 Codeigniter 的新手。我正在通过 css 为我的网站使用外部字体文件。这是我的css代码:
@font-face {
font-family: 'ElegantIcons';
src:url('http://localhost/findacare/font/ElegantIcons.eot'),
url('http://localhost/findacare/font/ElegantIcons.eot?#iefix') format('embedded-opentype'),
url('http://localhost/findacare/font/ElegantIcons.woff') format('woff'),
url('http://localhost/findacare/font/ElegantIcons.svg#ElegantIcons') format('svg'),
url('http://localhost/findacare/font/ElegantIcons.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
但我在加载文件时收到以下错误文件
GET http://localhost/findacare/font/ElegantIcons.woff 404 (Not Found) manage_profile:1
GET http://localhost/findacare/font/ElegantIcons.svg 404 (Not Found) /findacare/font/ElegantIcons.svg#ElegantIcons:1
GET http://localhost/findacare/font/ElegantIcons.ttf 404 (Not Found) /findacare/font/ElegantIcons.ttf:1
我的文件结构是:
findacare-
-application
-css
-font
-images
即使给出绝对路径,我也检查了很多次。谁能帮帮我。
【问题讨论】:
-
你的文件结构是
fonts; 404 消息正在查看font -
抱歉我的文件结构是字体。我打错了
-
请发布您的
.htacces。您的 htaccess 中可能有一个文件夹白名单,而您尚未指定字体文件夹。测试这一点的一种方法是将字体文件夹移动到 css 文件夹中并相应地更新链接。如果它开始工作,则说明您的字体文件夹尚未被列入白名单。 -
您的 webroot 中有一个
.htaccess文件(与您的index.php相同的目录)。我向您保证它就在那里,因为没有它您的应用程序将无法运行。.dot 格式的文件在某些操作系统上是隐藏的,因此您可能需要先显示隐藏文件才能打开它。 -
我已经将字体文件夹添加到重写条件中,现在我可以直接访问字体文件夹了..非常感谢您的帮助..我的问题已经解决了。
标签: php css codeigniter fonts