Today while I was creating a new button with the sprite technique I discovered that what it was working in all the browsers (the decent one: Firefox, Safari, Crome and IE8) it wasn’t working in IE7 and the CSS was not applied.
Pretty much while all the browsers were displaying the button as an image, IE7 and IE6 were displaying a resized default button (very ugly!!!)
My initial code was something like that:
#button_id{
width:439px;
height:53px;
border: none;
clear:both;
background-image:url(../images/btn-confirm.png);
background-repeat:no-repeat;
background-position:0 0;
}
I could not understand why just IE7 (and IE6 of course) were having this issues..
In the end I find the solution:
To display a background in a button in IE7 and IE6 you have to set the CSS style background-color
#order_button{
width:439px;
height:53px;
border: none;
clear:both;
background-image:url(../images/btn-confirm.png);
background-repeat:no-repeat;
background-position:0 0;
background-color:#f1f1f1; /* OF COURSE USE YOUR COLOR!! */
}
Popularity: 2% [?]







Hi
I am facing that problem in ie8 not in ie7 can you please update it , I puted that background color but its not working
If you paste here the code i’ll have a look.
Ps sometimes this works:
display: block;You Sir are my hero for the day!
Thanks a lot. I was struggling for 3 days to resolve above issue
I’ve also been struggling for 3 days with this problem and can’t get it work…nothing works..none of the solutions…:( i’m gonna pull my hair out pretty soon (i should mention that i’ve tryied a loooot of possibilities..with/without height and width..etc)
table.complet td.full { background: #ffffff url(”images/icons/star-full-flattened.png”) no-repeat scroll center!important; width: 23px!important; height:23px!important; }
table.complet td.half { background: #ffffff url(”images/icons/star-half-flattened.png”) no-repeat scroll center!important; width: 23px!important; height:23px!important;}
table.complet td.empty { background: #ffffff url(”images/icons/star-empty-flattened.png”) no-repeat scroll center!important; width: 23px!important; height:23px!important; }
i just replied send me the code and i’ll have a look..
Thanks for the info, I must bookmark your website for my reference
This was a great post, thanks for the info.