PrimeFaces:我如何使用自定义图标? [英] PrimeFaces: how can I make use of customized icons?

查看:138
本文介绍了PrimeFaces:我如何使用自定义图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PrimeFaces提供了许多来自jQuery themeroller的图标。他们是有用的,但我需要一些自定义图标我的应用程序。假设我有一个< p:commandButton>

PrimeFaces provides a lot of icons from jQuery themeroller. They're useful but I need to have some customized icons for my app. Suppose I have a <p:commandButton>:

<p:commandButton icon="ui-icon ui-icon-check" />

由于我的CSS知识非常有限,我非常感谢你能告诉我如何

Since my CSS knowledge is very limited, I'd be very grateful if you could show me how I can put some customized icon into the label of the above button.

最好的问候,

推荐答案

您需要定义自己的css类:

You need to define your own css class:

.img-button-help { background-image: url('../images/help.png') !important; }

,然后在 p:commandButton

<p:commandButton icon="img-button-help" />

这篇关于PrimeFaces:我如何使用自定义图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆