我在项目中第一次使用ico moon字体。
我的 icomoon css 文件:
@font-face {
font-family: 'icomoon';
src: url('fonts/icomoon.eot?nmzwdp');
src: url('fonts/icomoon.eot?nmzwdp#iefix') format('embedded-opentype'),
url('fonts/icomoon.ttf?nmzwdp') format('truetype'),
url('fonts/icomoon.woff?nmzwdp') format('woff'),
url('fonts/icomoon.svg?nmzwdp#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="inf-"], [class*=" inf-"] {
/* 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;
}
.inf-chrome:before {
content: "ead9";
}
.inf-chrome{ text-indent: 0 !important;
background-image: none !important;
font-size: 16px;
}
我使用 icomoon 字体的素数代码:
<p:commandButton value="Temps3" icon="inf-chrome"
style="height: 25px;width: auto;"/>
最后我的 ico moon 字体不显示,请任何人给出答案。
尝试添加 inf 类,该类应该适用于所有图标,此外还有特定于您的按钮的类 inf-chrome
<p:commandButton value="Temps3" icon="inf inf-chrome" style="height: 25px;width: auto;"/>
看起来你没有class
属性:
<p:commandButton class="inf-chrome" value="Temps3" icon="inf-chrome" style="height: 25px;width: auto;"/>
在你的CSS是选择器
[class^="inf-"], [class*=" inf-"]
这有必要吗?
.inf-chrome {
text-indent: 0 !important;
background-image: none !important;
font-size: 16px;
}
还要确保您的 icomoon 字体已正确加载。