I want to implement JSF button with image and custom label. I tested this code:
<h:commandButton id="savesettings" styleClass="avesettings" value=" Save Settings " action="#{GeneralController.updateDBSettings}" rendered="true" update="growl">
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
.avesettings {
background-image: url('../images/small.png');
}
This is the result:

I also tested this second code:
<h:commandButton id="savesettings" image="resources/images/first.png" value=" Save Settings " action="#{GeneralController.updateDBSettings}" rendered="true" update="growl">
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
I get this result with no label:

Can you help me to create JSF button with background image and custom label defined as button attribute?
The following JSF/CSS should solve your problem:
JSF (the same as in your first example):
CSS (adapted):
Width and height of the css must be the width and height of your image. I also have the css in an external css file, not direct in the JSF template.