2012-07-26 86 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