我想看看这个:
当我在<style></style>
标签之间包含修改后的 fontello CSS 时,它可以工作:
<!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
.