在CSS背景中使用webkit渐变和图像

时间:2013-02-04 03:18:09

标签: css webkit

我尝试将图像放在此类之上,并使用Web-Kit Gradiant保留当前背景

background: -webkit-gradient(linear, left bottom, left top, 
color-stop(0.03, #3A79C1), color-stop(0.99, #5F9EE6), 
color-stop(1, #75ABEA)) url(images/bg.gif) no-repeat center right;

虽然它添加背景而不是图像,但代码是对吗?

1 个答案:

答案 0 :(得分:1)

正确的想法,但是你错过了一个逗号,而且你希望你的图像显示在渐变之上..不在下面!所以重新安排订单。看看这个jsFiddle

background: url('images/bg.gif') no-repeat center right,-webkit-gradient(linear, left bottom, left top, 
color-stop(0.03, #3A79C1), color-stop(0.99, #5F9EE6), 
color-stop(1, #75ABEA)) ;