How to make an image button in JSF

后端 未结 4 1084
日久生厌
日久生厌 2021-02-18 14:37

I want to have a component that looks like a button, but instead of text it should contain an image. Because the standard button does not offer this functionality, I tried to u

4条回答
  •  悲哀的现实
    2021-02-18 14:46

    There are a couple ways you can add an image to a commandButton:

    Using the image attribute

    
    

    Absolute or relative URL of the image to be displayed for this button. If specified, this "input" element will be of type "image". Otherwise, it will be of the type specified by the "type" property with a label specified by the "value" property.

    Use CSS

    
    
    .button {
        background: white url('button.gif') no-repeat top;
    }
    

提交回复
热议问题