我想创建一个新图标以在我的 p:commandButton
中使用,但我失败了,我使用了这个方法
但对我没有用。我会告诉你我的代码:
CSS 代码:
.img-button-help { background-image: url('img/mag.ico') !important; }
jsf代码:
<p:commandButton icon="img-button-help" value="test" />
结果: 新结果 ->
如何在 Primefaces 中使用自定义图标??
最佳答案
您好,您可以尝试将 background-position
添加到您的 css,因为 primefaces 图像是基于 Sprite 的,而 .img-button-help
所做的是设置一个位置.试试这个:
.img-button-help {
background-image: url('img/mag.ico') !important;
background-position: center !important;
}
关于css - 如何在 primefaces 中创建自定义图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19594068/