0

I am using primefaces as a library and I'm trying to display an image in the background of a commanbutton. Here is my code:

  <p:commandButton image="button_image" type="submit" ajax="false" action="#{loginMB.connect()}"></p:commandButton>

In my style sheet i added this structure:

.button_image {
    background-image: url(../images/login.png) !important;
    width:82px;
    height:32px;
    border:0px;
    float: right;
    margin-right: 24px;
}

But what i get as a result is this enter image description here

And I am looking for this enter image description here

Pellizon
  • 1,365
  • 2
  • 12
  • 26
junior developper
  • 448
  • 2
  • 19
  • 40
  • Did you try so use `icon` instead of `image`? Because `image` is deprecated as stated in the Primeface documentation. – Manuel Nov 20 '13 at 13:32
  • Did you read [Displaying command button with image only](http://stackoverflow.com/questions/8003440/displaying-command-button-with-image-only) and [My own primefaces p:commanButton icon](http://stackoverflow.com/questions/17619707/my-own-primefaces-pcommanbutton-icon) ? – Manuel Nov 20 '13 at 13:34

0 Answers0