我遇到了一个图标字体的问题。我根本不能加载它们。但是,例如,如果我点击这个url:
localhost:8080/assets/fonts/icomoon.ttf (我正在处理的项目)
我可以把icomoon.ttf下载到我的电脑上。如果将它们安装在我的pc上,一切都很好。Icomoon字体工作。但这不是一个解决方案。
我怎么才能让它工作呢?我的相对路径似乎是正确的
这是我的结构的一个例子:
index---
|
assets
|_css
| |---icomoon.css
|
|_fonts
|icomoon files这是我的icomoon.css,供您查看:
@font-face {
font-family: 'icomoon';
src: url('../fonts/icomoon.eot?cl02ar');
src: url('../fonts/icomoon.eot?cl02ar#iefix') format('embedded-opentype'), url('../fonts/icomoon.ttf?cl02ar') format('truetype'), url('../fonts/icomoon.woff?cl02ar') format('woff'), url('../fonts/icomoon.svg?cl02ar#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"],
[class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: 'icomoon' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-andr:before {
content: "\e900";
}
.icon-arrow_b:before {
content: "\e901";
}
.icon-fbeps:before {
content: "\e902";
}
.icon-instagr:before {
content: "\e903";
}
.icon-instagram_iconeps:before {
content: "\e904";
}
.icon-map-markereps:before {
content: "\e905";
}
.icon-mc:before {
content: "\e906";
}
.icon-plus_b:before {
content: "\e907";
}
.icon-plus:before {
content: "\e908";
}
.icon-radio_icon:before {
content: "\e909";
}
.icon-search_icon:before {
content: "\e90a";
}
.icon-tw_iconeps:before {
content: "\e90b";
}
.icon-yteps:before {
content: "\e90c";
}
.icon-map-markereps2:before {
content: "\e90d";
}
.icon-close_btn:before {
content: "\e90f";
}
.icon-plus_b2:before {
content: "\e910";
}
.icon-plus2:before {
content: "\e911";
}
.icon-top_arrow:before {
content: "\e912";
}
.icon-video_play:before {
content: "\e913";
}
.icon-arrow_c:before {
content: "\e914";
}
.icon-burger:before {
content: "\e915";
}
.icon-minus:before {
content: "\e90e";
}提前谢谢你
发布于 2018-03-23 17:35:07
这真的应该是与css目录相对的吗?
路径不应该来自Apache基本路径吗?
src: url('assets/fonts/icomoon.eot?cl02ar');https://stackoverflow.com/questions/36361914
复制相似问题