6 Replies Latest reply on Sep 13, 2012 8:07 AM by Brendan Healey

    How to add background image and icon to a JSF button?

    Ashish Agarwal Newbie

      am using JSF 2.0
      I am able to add Background image to the JSF button but am not able to add icon to the button.

      My Requirement is:- JSF button with Background image and a Icon

      Following code am using to add background.

        <!-- Discard button-->

      <h:commandButton action="discard"  style="background-image: url('..\\Images\\leftMenuActiveBg.png');width: 150px;height: 30px;color: white;border-color: white;font-size: 15px; "  value="#{message.discard}">
      <rich:componentControl target="popup" operation="show" />
      </h:commandButton>

       

      StackOverFlow.png

      I am updating a image for better Explainanation as what I want to achieve and I what I have achieved till now with above code.

      Can somebody help me in adding a icon to the button too please.