How to make an image button in JSF

后端 未结 4 1066
日久生厌
日久生厌 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:39

    If the image does not fit then add properties to a сss class:

    .button {
        background: white url('button.gif') no-repeat top;
        width: 32px;   // button width
        height: 32px;  // button height
        background-size: contain;
        border: none;  // hide border of button
    }
    

提交回复
热议问题