Separate background-image and webkit-gradient into two separate css declarations
Currently, I have the following class:
#btnHelp
{
background: url(images/btnHelp.png) center no-repeat, -webkit-gradient(linear, left top, left bottom, from(#9adc6d), to(#6eba3a));
}
I'd like to separate out the background image part from the gradient part into 2 separate classes, like this:
#btnHelp
{
background-image: url(images/btnHelp.png);
background-position:center;
background-repeat:no-repeat;
}
.green
{
background: -webkit-gradient(linear, left top, left bottom, from(#9adc6d), to(#6eba3a));
}
but one overwrites the other, rather than combi开发者_JAVA百科ning the two.
You can't. According to the webkit blog post:
You can use gradients in the following places:
background-image
border-image
list-style-image
content property
Of which, the only one that is useful to you is background-image. You can obviously separate out the position and repetition sections though.
精彩评论