Background Image for Input Button with CSS (works in both Firefox and IE)

I was having trouble with setting a background image for an input button in IE 6. The background-image property that worked in Firefox 2.0 just did not have any effect on IE6. After a bit of googling, I realized that the background-image property will not work on IE and that we need to use the background property. Here’s a snippet that works on both browsers:

<input type=”button” class=”button” title=”Background Image” />

.button{
      background: white url(‘images/imagebutton.gif’) no-repeat top;
      width: 150px;
      height: 40px;
      color:white;
}

9 Responses

  1. helpful. thanks.

  2. I was searching a solution to this stupid problem for few hours. Thank you so much. Now it works for me.

  3. Excellent ! Many thanks.

  4. Thanks for sharing ;-) .

  5. Thanks !

  6. Very nice one

  7. thank you that helped me ;)

  8. Nice Code

  9. Great post!!!! Thanks for sharing… :)

Leave a Reply