我想看看这个:

当我在<style></style>标记之间包含修改后的fontello时,它可以工作:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- <link rel="stylesheet" type="text/css" href="css/fontello_mod.css"/> -->
</head>
<style>
@font-face {
font-family: 'fontello';
src: url('font/fontello.eot?47332372');
src: url('font/fontello.eot?47332372#iefix') format('embedded-opentype'),
url('font/fontello.woff?47332372') format('woff'),
url('font/fontello.ttf?47332372') format('truetype'),
url('font/fontello.svg?47332372#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
.icon {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */
/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;
/* fix buttons height, for twitter bootstrap */
line-height: 1em;
/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;
/* You can be more comfortable with increased icons size */
font-size: 220%;
/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
<body>
<i class="icon"></i><i class="icon"></i>
</body>
</html>因此,由于一切看起来都很好,所以我将CSS移到外部工作表中,并删除了<style></style>位:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/fontello_mod.css"/>
</head>
<!-- <style></style> -->
<body>
<i class="icon"></i><i class="icon"></i>
</body>
</html>但是现在,我的图标看起来是这样的:

两者之间的CSS是相同的(复制和粘贴)。为什么会发生这种情况?我该怎么修呢?
我不确定这是否相关,但我现在正在使用Chrome和XAMPP (仅限于Apache)。
编辑:
这是我的文件夹结构:

html文档名为demo.html,位于文件夹A2 (http://localhost/573/A2/demo.html)中。CSS样式表是A2/css/fontello_mod.css。
发布于 2016-04-04 05:32:57
您的css文件没有获得font文件夹。将您的"fontello“字体文件夹放在该css文件夹中。
发布于 2016-04-04 05:31:02
如果将代码移动到外部源,则检查字体文件的路径。
然后你必须写上"../“之类的词:
url('../font/fontello.eot?47332372');发布于 2016-04-04 06:05:34
将所有字体urls更改为
@font-face {
font-family: 'fontello';
src: url('..//font/fontello.eot?47332372');
src: url('..//font/fontello.eot?47332372#iefix') format('embedded-opentype'),
url('..//font/fontello.woff?47332372') format('woff'),
url('..//font/fontello.ttf?47332372') format('truetype'),
url('..//font/fontello.svg?47332372#fontello') format('svg');
font-weight: normal;
font-style: normal;}
https://stackoverflow.com/questions/36395099
复制相似问题