我无法显示我的图标字体。这是我的目录结构:
包含css和fonts文件夹的_文件夹在_文件夹之外我有demo1.html页面
这是我用来设置字体的代码:
@font-face {
font-family: 'icomoon';
src:url('_/fonts/icomoon.eot?-9hqo51');
src:url('_/fonts/icomoon.eot?#iefix-9hqo51') format('embedded-opentype'),
url('_/fonts/icomoon.woff?-9hqo51') format('woff'),
url('_/fonts/icomoon.ttf?-9hqo51') format('truetype'),
url('_/fonts/icomoon.svg?-9hqo51#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}html代码如下:
<span aria-hidden="true" class="icon-raja_head"></span>这是我设置的sample页面。字体的代码在我的样式表的第903行。
谢谢-Sohail
发布于 2014-09-22 22:43:26
你的src引用是相对的,所以你的css命令在你的_目录中名为_的目录中寻找字体。这就是它从根目录开始工作的原因。
您需要更正'fonts/icomoon.eot?-9hqo51'的相对路径,或者在路径前面加上/使其成为绝对路径,例如:'/_/fonts/icomoon.eot?-9hqo51'
https://stackoverflow.com/questions/25739591
复制相似问题