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;
}
helpful. thanks.
I was searching a solution to this stupid problem for few hours. Thank you so much. Now it works for me.
Excellent ! Many thanks.
Thanks for sharing ;-).
Thanks !
Very nice one
thank you that helped me 😉
Nice Code
Great post!!!! Thanks for sharing… 🙂
This is great! However… the button now looks distinctly different than buttons with default style. I would like to have a button with a little icon on the left and with text on the right but other than that default styling. Any tips?
you should consider having an input [image] instead…
And now how do I get the psuedo class hover to work with it?
Tried:
.button:hover {
background: white url(‘images/imagebutton-on.gif’) no-repeat top;
}
and no love.
How about handling the over state of the input button?
I shall answer my own question: apply the :hover pseudo class to the element in question:
.button:hover{
background: white url(‘images/imagebutton_over.gif’) no-repeat top;
}
Great, thanks for the hint, saved me a lot of time!
Nice one! I’ve been looking for this for a few hours.
Thanks it worked!! 🙂 🙂
Thanks!
Excellent post – saved me some time also.
Thank you!
bc
Thanks a lot!
hey many thanks its really helpful to me 🙂
Thank you SO much! Easy example and quick to fix.
I also set border to none
Thanx
Very useful, thanks!
Caveat – If you are using more then one submit button, then this won’t work on internet explorer,
Thanks, Nice example
Yes thanks too
Thanks you for your tip!
Yes, this was it. Thanks.
like this tips for very useful thanks
Thanks, nice trick