Question

I'm trying to add a logo to one button that is styled with gradient, but the background-image "delete" the background color...

Here is the fiddle: http://jsfiddle.net/FDXy5/ and below is the current tet .css.

.rounded-orange-button {
text-align: center;
color: #FFFFFF;
display: inline-block;
border-radius: 2px;
line-height: 27px;
width: 200px;
position: relative;
background: #FF9100;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#FF9100) to(#FA6800));
background: -webkit-linear-gradient(top, #FF9100, #FA6800);
background: -moz-linear-gradient(top, #FF9100, #FA6800);
background: -o-linear-gradient(top, #FF9100, #FA6800);
background: linear-gradient(to bottom, #FF9100, #FA6800);
-pie-background: linear-gradient(to bottom, #FF9100, #FA6800);
}

.logo-edit{
    background-image: url('http://www.w3schools.com/cssref/smiley.gif');
    background-repeat:no-repeat;
}

Thanks to help me :-)

Was it helpful?

Solution

The graident is actually a background image as well. Luckily you can, in modern browsers, have multiple background images.

Example:

background-image: url('http://www.w3schools.com/cssref/smiley.gif'), linear-gradient(to bottom, #FF9100, #FA6800);

And you also need to do the same for the vendor specific gradients.

jsFiddle

See this link for compatibility table: background-image MDN

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top