Can I add an image to an ASP.NET button?

后端 未结 7 669
野趣味
野趣味 2020-12-20 11:17

I want to add an image, instead of the default button.

I already have a CSS class for the image, will this work?



        
7条回答
  •  臣服心动
    2020-12-20 11:34

    Assuming a Css class of "image" :

    input.image { 
      background: url(/i/bg.png) no-repeat top left; 
      width: /* img-width */; 
      height: /* img-height */ 
    }
    

    If you don't know what the image width and height are, you can set this dynamically with javascript.

提交回复
热议问题