2012-07-26 100 views

回答

0

我会建议延长渐变图像,以便它可以更早地达到灰色(所以灰色是您的确切所需的阴影,而不是一个阴影)或使用 -webkit-gradient(一些旧版浏览器可能不支持它....)

例如:

background: url(http://i.imgur.com/ajzo0.jpg) rgb(145,127,103); /* Old browsers (in case they don't support webkit, use the original image. */ 
background: -moz-linear-gradient(top, rgba(145,127,103,1) 0%, rgba(236,235,233,1) 100%); /* FF3.6+ */ 
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(145,127,103,1)), color-stop(100%,rgba(236,235,233,1))); /* Chrome,Safari4+ */ 
background: -webkit-linear-gradient(top, rgba(145,127,103,1) 0%,rgba(236,235,233,1) 100%); /* Chrome10+,Safari5.1+ */ 
background: -o-linear-gradient(top, rgba(145,127,103,1) 0%,rgba(236,235,233,1) 100%); /* Opera 11.10+ */ 
background: -ms-linear-gradient(top, rgba(145,127,103,1) 0%,rgba(236,235,233,1) 100%); /* IE10+ */ 
background: linear-gradient(to bottom, rgba(145,127,103,1) 0%,rgba(236,235,233,1) 100%); /* W3C */ 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#917f67', endColorstr='#ecebe9',GradientType=0); /* IE6-9 */ 

是的,这是一个很大的代码,但它确实完成工作。

+0

注意:你需要添加一个新的类....参见:http://jsfiddle.net/JfyAR/ – nwong212 2012-07-26 05:38:43