|
楼主 |
发表于 2016-9-6 09:23:18
|
显示全部楼层
解决了。修改了字体目录下css的内容,保证类名和css的文件名一样,同时不能使用已有的类名,就可以了,因为X5自带一个叫icon的类,而我下载的icomoon的默认css文件里也有这个icon类,后来改成icomoon类,同时把css文件名style.css改成icomoon.icons.css就可以了。css内容如下:
但是好像eclipse要重启才能在设计器里看到更新后的图标,不过在浏览器里马上可以看到。
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?4a54yu');
src: url('fonts/icomoon.eot?4a54yu#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?4a54yu') format('truetype'),
url('fonts/icomoon.woff?4a54yu') format('woff'),
url('fonts/icomoon.svg?4a54yu#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
.icomoon .icomoon-shoeprints {
/* 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-shoeprints:before {
content: "\e900";
}
原先下载的css是这样子的:
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?4a54yu');
src: url('fonts/icomoon.eot?4a54yu#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?4a54yu') format('truetype'),
url('fonts/icomoon.woff?4a54yu') format('woff'),
url('fonts/icomoon.svg?4a54yu#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-shoeprints:before {
content: "\e900";
}
|
|